	Crystal Report Professional v8.5 (32-bit) - Report Definition

1.0 File Information

	Report File: 
	Version: 8.0

2.0 Record Sort Fields

3.0 Group Sort Fields

4.0 Formulas

4.1 Record Selection Formula
	

4.2 Group Selection Formula
	

4.3 Other Formulas

	Name: {@OrderNumber}
	Formula: StringVar NewString;
	StringVar String := ToText({Orders.Order Number});
	if Length(String) > 6 then
	  NewString := Left(String,6) + '-'
	else
	  NewString := String;
	
	if  Length(String) >10 then
	   NewString := NewString + Mid(String,7,4) + '-'+Right(String,Length(String) - 10)
	else if Length(String) > 6 then
	  NewString := NewString + Right(String,Length(String) - 6);
	
	NewString
	

	Name: {@IsReprint}
	Formula: if ({Orders.nInvoiceStatus} <> 0) Then
	 {@Reprint_ID690}
	else
	  ""

	Name: {@OrderNo_ID691}
	Formula: "Order no.:"
	

	Name: {@OrderBCNumber}
	Formula: Dim sDisplayValue As String     'final display value
	Dim sSingleLine As String       'single bar code line
	Dim sCode39 As String           'code 39 formated data
	Dim SingleChar As String        'single character
	Dim nPos As Number              'current position
	   
	sDisplayValue = "(" + Trim(UCase({Orders.Order Number})) + ")"
	
	For nPos = 1 To Len(sDisplayValue) Step 1
	   SingleChar = Mid(sDisplayValue, nPos, 1)
	   If SingleChar = " " Then SingleChar = "="
	   sCode39 = sCode39 & SingleChar
	Next nPos
	
	Formula = sCode39
	
	

	Name: {@IsReprint}
	Formula: if ({Orders.nInvoiceStatus} <> 0) Then
	 {@Reprint_ID690}
	else
	  ""

	Name: {@OrderNo_ID691}
	Formula: "Order no.:"
	

	Name: {@DataEntry_ID696}
	Formula: "Data Entry"
	

	Name: {@InvoiceTo_ID697}
	Formula: "Invoice Address:"
	

	Name: {@DeliverTo_ID698}
	Formula: "Deliver to:"
	

	Name: {@DateOrdered}
	Formula: StringVar sYear := Left({Orders.Date Ordered},4);
	StringVar sMonth := Mid({Orders.Date Ordered},6,2);
	StringVar sDay := Mid({Orders.Date Ordered},9,2); 
	
	
	NumberVar nYear :=  ToNumber(Left({Orders.Date Ordered},4));
	NumberVar nMonth := ToNumber(Mid({Orders.Date Ordered},6,2));
	NumberVar nDay := ToNumber(Mid({Orders.Date Ordered},9,2)); 
	ToText(Date(nYear,nMonth,nDay),"dd MMM yyyy")
	
	

	Name: {@DateOrderFinished}
	Formula: if IsNull({Orders.Date Order Finished}) then
	   ""
	else
	  {@FormatDateOrderFinished}
	

	Name: {@DateOrdered_ID712}
	Formula: "Date ordered:"
	

	Name: {@DateShipped_ID713}
	Formula: "Date shipped:"
	

	Name: {@PaymentStatus}
	Formula: if ({Orders.nPaymentStatus} = 0) then
	  {@PSPPending_ID723}
	else if ({Orders.nPaymentStatus} = 1) then
	  {@Received_ID724}
	else if ({Orders.nPaymentStatus} = 2) then
	  {@Rejected_ID725}
	else if ({Orders.nPaymentStatus} = 3) then
	  {@Error_ID726}
	else if ({Orders.nPaymentStatus} = 4) then
	  {@PreAuth_ID727}
	else if ({Orders.nPaymentStatus} = 5) then
	  {@Waiting_ID728}
	else if ({Orders.nPaymentStatus} = 6) then
	  {@Pending_ID729}
	// OCC test mode changed from 7 to 8
	else if ({Orders.nPaymentStatus} = 8) then
	  {@PSPTestMode_ID730}
	  else if ({Orders.nPaymentStatus} = 9) then
	  {@PartialPaymentReceived_ID975}
	else if ({Orders.nPaymentStatus} = 10) then
	  {@FullPaymentReceived_ID974}
	else if ({Orders.nPaymentStatus} = 11) then
	  {@ExcessPaymentReceived_ID976}
	
	
	

	Name: {@PaymentMethod_ID714}
	Formula: "Payment method:"
	

	Name: {@PaymentStatus_ID722}
	Formula: "Payment status:"
	

	Name: {@CardType_ID731}
	Formula: "Card type:"
	

	Name: {@Number_ID732}
	Formula: "Number:"
	

	Name: {@CC}
	Formula: If {Orders.nEncryptionType} = 2 And Not IsNull({Orders.sEncryptionData}) Then
	    ActCardCryptCardCryptCtrl12DecryptBlowfish ({@SymmetricKey}, {Orders.sEncryptionData}, {Orders.nEncryptionType}, "CCNumber", "")
	Else
	     {Orders.Credit Card Number}
	

	Name: {@CCType}
	Formula: If {Orders.nEncryptionType} = 2 And Not IsNull({Orders.sEncryptionData}) Then
	    ActCardCryptCardCryptCtrl12DecryptBlowfish ({@SymmetricKey}, {Orders.sEncryptionData}, {Orders.nEncryptionType}, "CCType", "")
	Else
	   {Orders.Credit Card Type}
	
	
	
	

	Name: {@OrderBCCCNumber}
	Formula: Dim nMaxLength As Number        'maximum length of bar code lines
	Dim nIndex As Number            'array index
	Dim sArray() As String          'splitted string array
	Dim sDisplayValue As String     'final display value
	Dim sSingleLine As String       'single bar code line
	Dim sCode39 As String           'code 39 formated data
	Dim SingleChar As String        'single character
	Dim nPos As Number              'current position
	
	nMaxLength = 20                 'limit the bar code length
	sDisplayValue = ""              'initialize the dispaly value           
	sSingleLine = ""
	
	sArray = Split(Trim(UCase({@CC})))
	
	For nIndex = 1 To UBound(sArray) Step 1
	   If Len(sSingleLine + sArray(nIndex)) > nMaxLength Then 'length exceeds the limit so add new line
	      If (Len(sSingleLine) > 1) Then
	         sDisplayValue = sDisplayValue + "("  + sSingleLine + ")" + Chr(13)
	      ElseIf (Len(sSingleLine) = 1) Then
	         sDisplayValue = sDisplayValue + "("  + sSingleLine + "=)" + Chr(13)
	      End If
	      sSingleLine = ""
	      For nPos = 1 To Len(sArray(nIndex)) Step nMaxLength
	         sSingleLine = Trim(Mid(sArray(nIndex), nPos, nMaxLength))
	         If Len(sSingleLine) = nMaxLength Then 
	            sDisplayValue = sDisplayValue + "("  + sSingleLine + ")" + Chr(13)
	            sSingleLine = ""
	         End If
	      Next nPos
	   Else
	      If Len(sSingleLine) = 0 Then
	         sSingleLine = sArray(nIndex) 'append to current line
	      Else
	         sSingleLine = sSingleLine + "=" + sArray(nIndex) 'append to current line
	      End If
	   End If
	Next nIndex
	
	If (Len(sSingleLine) > 1) Then
	   sDisplayValue = sDisplayValue + "("  + sSingleLine + ")"
	ElseIf (Len(sSingleLine) = 1) Then
	   sDisplayValue = sDisplayValue + "("  + sSingleLine + "=)"
	End If
	
	For nPos = 1 To Len(sDisplayValue) Step 1
	   SingleChar = Mid(sDisplayValue, nPos, 1)
	   If SingleChar = " " Then SingleChar = "="
	   sCode39 = sCode39 & SingleChar
	Next nPos
	
	Formula = sCode39

	Name: {@CardType_ID731}
	Formula: "Card type:"
	

	Name: {@Number_ID732}
	Formula: "Number:"
	

	Name: {@CC}
	Formula: If {Orders.nEncryptionType} = 2 And Not IsNull({Orders.sEncryptionData}) Then
	    ActCardCryptCardCryptCtrl12DecryptBlowfish ({@SymmetricKey}, {Orders.sEncryptionData}, {Orders.nEncryptionType}, "CCNumber", "")
	Else
	     {Orders.Credit Card Number}
	

	Name: {@CCType}
	Formula: If {Orders.nEncryptionType} = 2 And Not IsNull({Orders.sEncryptionData}) Then
	    ActCardCryptCardCryptCtrl12DecryptBlowfish ({@SymmetricKey}, {Orders.sEncryptionData}, {Orders.nEncryptionType}, "CCType", "")
	Else
	   {Orders.Credit Card Type}
	
	
	
	

	Name: {@CreditCardIssueNumber}
	Formula: if ( Not(IsNull({@CCIssue}) AND {@CCIssue} <> "-1") ) then
	  {@CCIssue}
	else
	  ""
	

	Name: {@ExpiryDate}
	Formula: StringVar CCDate := {@CCExpiry};
	
	if (len(CCDate) <> 0) then
	    Right(CCDate, 2) + "/" + Left(CCDate, 4)
	else
	    ""
	
	

	Name: {@ExpiryDate_ID734}
	Formula: "Expiry date:"
	

	Name: {@CVV2_ID1923}
	Formula: "CVV2:"
	

	Name: {@CVV2}
	Formula: If {Orders.nEncryptionType} = 2 And Not IsNull({Orders.sEncryptionData}) Then
	    ActCardCryptCardCryptCtrl12DecryptBlowfish ({@SymmetricKey}, {Orders.sEncryptionData}, {Orders.nEncryptionType}, "CCCVV2", "")
	Else
	   {Orders.sCreditCardVV2}
	
	
	

	Name: {@StartDate}
	Formula: StringVar CCDate := {@CCStart};
	
	if (len(CCDate) <> 0) then
	    Right(CCDate, 2) + "/" + Left(CCDate, 4)
	else
	    ""
	

	Name: {@StartDate_ID733}
	Formula: "Start date:"
	

	Name: {@CreditCardIssueNumber}
	Formula: if ( Not(IsNull({@CCIssue}) AND {@CCIssue} <> "-1") ) then
	  {@CCIssue}
	else
	  ""
	

	Name: {@IssueNum_ID736}
	Formula: "Issue number:"
	

	Name: {@bOrderType}
	Formula: //
	// Display if offline or online order type
	//
	if ({Orders.bOfflineOrder}) then
	    (
	    {@OffLineOrder_ID2311};
	    )
	else
	    (
	    {@OnLineOrder_ID2360};
	    )
	

	Name: {@OrderType_ID2359}
	Formula: "Order Type:"
	

	Name: {@ECI_TYPE}
	Formula: if ({Orders.bECI}) then
	    (
	    {@ECI_YES_ID2314};
	    )
	else
	    (
	    {@ECI_NO_ID2315};
	    )
	

	Name: {@ECI_ID2313}
	Formula: "ECI:"
	

	Name: {@ShippingMethod}
	Formula: If IsNull({Orders.sShippingDescription}) Then
	  {@Simple_ID739}
	else
	  {Orders.sShippingDescription}
	

	Name: {@PONum_ID737}
	Formula: "Purchase order No.:"
	

	Name: {@ShippingMethod_ID738}
	Formula: "Shipping method:"
	

	Name: {@UserDef1_ID740}
	Formula: "User definable 1"
	

	Name: {@UserDef2_ID741}
	Formula: "User definable 2"
	

	Name: {@UserDef3_ID742}
	Formula: "User definable 3"
	

	Name: {@LinesTotal_ID743}
	Formula: "Lines - Total:"
	

	Name: {@Shipped_ID744}
	Formula: "Shipped:"
	

	Name: {@Cancelled_ID745}
	Formula: "Cancelled:"
	

	Name: {@Backordered_ID746}
	Formula: "Back ordered:"
	

	Name: {@Currency_ID747}
	Formula: "Currency:"
	

	Name: {@SubTotalCost}
	Formula: //
	// Put the specific field being converted in here
	//
	
	numberVar dPrice := Round({@OrdersCostExVat});
	//
	// All of the following code should stay the same
	//
	numberVar dOriginalPrice := dPrice;
	stringVar array sThouFormat := ["#","##","###","#,###","##,###","###,###","#,###,###","##,###,###","###,###,###","#,###,###,###"];
	stringVar array sDecFormat := ["", "0", "00", "000", "0000"];
	stringVar sThous := {currencies.SMONTHOUSANDSEP};
	stringVar sDec := {currencies.SMONDECIMALSEP};
	numberVar nDigits := {currencies.ICURRDIGITS};
	numberVar dDecimalPrice;
	numberVar dPos := 1;
	if (dPrice < 0) then
	   dPos := 0;
	if (dPrice < 0) then
	   dPrice := Abs(dPrice);
	dDecimalPrice := 0;
	if (nDigits = 1) then
	   dDecimalPrice :=Abs( Round(10 * ((dPrice / 10) - Truncate(dPrice / 10))));
	if (nDigits = 1) then
	   dPrice := dPrice / 10;
	if (nDigits = 2) then
	   dDecimalPrice := Abs(Round(100 * ((dPrice / 100) - Truncate(dPrice / 100))));
	if (nDigits = 2) then
	   dPrice := dPrice / 100;
	if (nDigits = 3) then
	   dDecimalPrice := Abs(Round(1000 * ((dPrice / 1000) - Truncate(dPrice / 1000))));
	if (nDigits = 3) then
	   dPrice := dPrice / 1000;
	if (nDigits = 4) then
	   dDecimalPrice := Abs(Round(10000 * ((dPrice / 10000) - Truncate(dPrice / 10000))));
	if (nDigits = 4) then
	   dPrice := dPrice / 10000;
	//
	// Work out how many digits in the result
	//
	dPrice := Truncate(dPrice);
	numberVar nSigDigits := Length(ToText(dPrice,"#"));
	if (nSigDigits > 10) then
	   nSigDigits :=10;
	if (nSigDigits < 1) then
	   nSigDigits := 1;
	//
	// Construct format string - thousands side plus decimal side
	//
	stringVar sActualFormat := sThouFormat[nSigDigits];
	//
	// Carry out the conversion and then determine required format
	//
	stringVar sValue := ToText(dPrice,sActualFormat,0,sThous,sDec);
	if (nDigits <> 0) then
	   sValue := sValue + sDec + ToText(dDecimalPrice, sDecFormat[nDigits+1],0);
	if (dPos = 1 And {currencies.ICURRENCY} = 0) then
	     {currencies.SCURRENCY} + sValue
	else if (dPos = 1 And {currencies.ICURRENCY} = 1) then
	     sValue  + {currencies.SCURRENCY}
	else if (dPos = 1 And {currencies.ICURRENCY} = 2) then
	      {currencies.SCURRENCY} + " " + sValue
	else if (dPos = 1 And {currencies.ICURRENCY} = 3) then
	     sValue  + "  " + {currencies.SCURRENCY}
	else if (dPos = 0 And {currencies.INEGCURR} = 0) then
	    "(" + {currencies.SCURRENCY} + sValue + ")"
	else if (dPos = 0 And {currencies.INEGCURR} = 1) then
	    "-" + {currencies.SCURRENCY} + sValue
	else if (dPos = 0 And {currencies.INEGCURR} = 2) then
	    {currencies.SCURRENCY} + "-" + sValue
	else if (dPos = 0 And {currencies.INEGCURR} = 3) then
	    {currencies.SCURRENCY} + sValue + "-"
	else if (dPos = 0 And {currencies.INEGCURR} = 4) then
	    "(" + sValue + {currencies.SCURRENCY} + ")"
	else if (dPos = 0 And {currencies.INEGCURR} = 5) then
	    "-" + sValue + {currencies.SCURRENCY}
	else if (dPos = 0 And {currencies.INEGCURR} = 6) then
	    sValue +"-" + {currencies.SCURRENCY}
	else if (dPos = 0 And {currencies.INEGCURR} = 7) then
	    sValue + {currencies.SCURRENCY} + "-"
	else if (dPos = 0 And {currencies.INEGCURR} = 8) then
	    "-" + sValue + " " + {currencies.SCURRENCY}
	else if (dPos = 0 And {currencies.INEGCURR} = 9) then
	    "-" + {currencies.SCURRENCY} + " " + sValue
	else if (dPos = 0 And {currencies.INEGCURR} = 10) then
	    sValue + " " + {currencies.SCURRENCY} + "-"
	else if (dPos = 0 And {currencies.INEGCURR} = 11) then
	    {currencies.SCURRENCY} + " " + sValue + "-"
	else if (dPos = 0 And {currencies.INEGCURR} = 12) then
	    {currencies.SCURRENCY} + " -" + sValue
	else if (dPos = 0 And {currencies.INEGCURR} = 13) then
	    sValue+ "- "  + {currencies.SCURRENCY}
	else if (dPos = 0 And {currencies.INEGCURR} = 14) then
	    "(" + {currencies.SCURRENCY} + " " + sValue + ")"
	else if (dPos = 0 And {currencies.INEGCURR} = 15) then
	    "(" + sValue + " " + {currencies.SCURRENCY} +")"
	else
	    {@FormatError_ID787}
	

	Name: {@Subtotal_ID758}
	Formula: "Subtotal"
	

	Name: {@DiscountCost}
	Formula: //
	// Put the specific field being converted in here
	//
	numberVar dPrice := Round({Orders.Discount Cost});
	//
	// All of the following code should stay the same
	//
	numberVar dOriginalPrice := dPrice;
	stringVar array sThouFormat := ["#","##","###","#,###","##,###","###,###","#,###,###","##,###,###","###,###,###","#,###,###,###"];
	stringVar array sDecFormat := ["", "0", "00", "000", "0000"];
	stringVar sThous := {currencies.SMONTHOUSANDSEP};
	stringVar sDec := {currencies.SMONDECIMALSEP};
	numberVar nDigits := {currencies.ICURRDIGITS};
	numberVar dDecimalPrice;
	numberVar dPos := 1;
	if (dPrice < 0) then
	   dPos := 0;
	if (dPrice < 0) then
	   dPrice := Abs(dPrice);
	dDecimalPrice := 0;
	if (nDigits = 1) then
	   dDecimalPrice :=Abs( Round(10 * ((dPrice / 10) - Truncate(dPrice / 10))));
	if (nDigits = 1) then
	   dPrice := dPrice / 10;
	if (nDigits = 2) then
	   dDecimalPrice := Abs(Round(100 * ((dPrice / 100) - Truncate(dPrice / 100))));
	if (nDigits = 2) then
	   dPrice := dPrice / 100;
	if (nDigits = 3) then
	   dDecimalPrice := Abs(Round(1000 * ((dPrice / 1000) - Truncate(dPrice / 1000))));
	if (nDigits = 3) then
	   dPrice := dPrice / 1000;
	if (nDigits = 4) then
	   dDecimalPrice := Abs(Round(10000 * ((dPrice / 10000) - Truncate(dPrice / 10000))));
	if (nDigits = 4) then
	   dPrice := dPrice / 10000;
	//
	// Work out how many digits in the result
	//
	dPrice := Truncate(dPrice);
	numberVar nSigDigits := Length(ToText(dPrice,"#"));
	if (nSigDigits > 10) then
	   nSigDigits :=10;
	if (nSigDigits < 1) then
	   nSigDigits := 1;
	//
	// Construct format string - thousands side plus decimal side
	//
	stringVar sActualFormat := sThouFormat[nSigDigits];
	//
	// Carry out the conversion and then determine required format
	//
	stringVar sValue := ToText(dPrice,sActualFormat,0,sThous,sDec);
	if (nDigits <> 0) then
	   sValue := sValue + sDec + ToText(dDecimalPrice, sDecFormat[nDigits+1],0);
	if (dOriginalPrice = 0) then
	   ""
	else if (dPos = 1 And {currencies.ICURRENCY} = 0) then
	     {currencies.SCURRENCY} + sValue
	else if (dPos = 1 And {currencies.ICURRENCY} = 1) then
	     sValue  + {currencies.SCURRENCY}
	else if (dPos = 1 And {currencies.ICURRENCY} = 2) then
	      {currencies.SCURRENCY} + " " + sValue
	else if (dPos = 1 And {currencies.ICURRENCY} = 3) then
	     sValue  + "  " + {currencies.SCURRENCY}
	else if (dPos = 0 And {currencies.INEGCURR} = 0) then
	    "(" + {currencies.SCURRENCY} + sValue + ")"
	else if (dPos = 0 And {currencies.INEGCURR} = 1) then
	    "-" + {currencies.SCURRENCY} + sValue
	else if (dPos = 0 And {currencies.INEGCURR} = 2) then
	    {currencies.SCURRENCY} + "-" + sValue
	else if (dPos = 0 And {currencies.INEGCURR} = 3) then
	    {currencies.SCURRENCY} + sValue + "-"
	else if (dPos = 0 And {currencies.INEGCURR} = 4) then
	    "(" + sValue + {currencies.SCURRENCY} + ")"
	else if (dPos = 0 And {currencies.INEGCURR} = 5) then
	    "-" + sValue + {currencies.SCURRENCY}
	else if (dPos = 0 And {currencies.INEGCURR} = 6) then
	    sValue +"-" + {currencies.SCURRENCY}
	else if (dPos = 0 And {currencies.INEGCURR} = 7) then
	    sValue + {currencies.SCURRENCY} + "-"
	else if (dPos = 0 And {currencies.INEGCURR} = 8) then
	    "-" + sValue + " " + {currencies.SCURRENCY}
	else if (dPos = 0 And {currencies.INEGCURR} = 9) then
	    "-" + {currencies.SCURRENCY} + " " + sValue
	else if (dPos = 0 And {currencies.INEGCURR} = 10) then
	    sValue + " " + {currencies.SCURRENCY} + "-"
	else if (dPos = 0 And {currencies.INEGCURR} = 11) then
	    {currencies.SCURRENCY} + " " + sValue + "-"
	else if (dPos = 0 And {currencies.INEGCURR} = 12) then
	    {currencies.SCURRENCY} + " -" + sValue
	else if (dPos = 0 And {currencies.INEGCURR} = 13) then
	    sValue+ "- "  + {currencies.SCURRENCY}
	else if (dPos = 0 And {currencies.INEGCURR} = 14) then
	    "(" + {currencies.SCURRENCY} + " " + sValue + ")"
	else if (dPos = 0 And {currencies.INEGCURR} = 15) then
	    "(" + sValue + " " + {currencies.SCURRENCY} +")"
	else
	    {@FormatError_ID787}
	

	Name: {@Discount}
	Formula: //
	// If the discount is - then it is discount
	// if the discount value is + then it is surcharge
	// display the discount percentage without the sign
	//
	if ({Orders.Discount Percent} < 0)  then
	    (
	    Left({@Discount_ID759} +  ' ' + ToText(-{Orders.Discount Percent}/100) + {@PercentSign_ID1042}, 255)
	    )
	else
	    (
	    Left({@Surcharge_ID2222} + ' ' + ToText({Orders.Discount Percent}/100) + {@PercentSign_ID1042},255)
	    )
	
	
	
	
	
	
	

	Name: {@ShippingNote_ID760}
	Formula: "Shipping note:"
	

	Name: {@ShippingTotalCost}
	Formula: //
	// Put the specific field being converted in here
	//
	numberVar dPrice := Round({@ShippingCost});
	//
	// All of the following code should stay the same
	//
	numberVar dOriginalPrice := dPrice;
	stringVar array sThouFormat := ["#","##","###","#,###","##,###","###,###","#,###,###","##,###,###","###,###,###","#,###,###,###"];
	stringVar array sDecFormat := ["", "0", "00", "000", "0000"];
	stringVar sThous := {currencies.SMONTHOUSANDSEP};
	stringVar sDec := {currencies.SMONDECIMALSEP};
	numberVar nDigits := {currencies.ICURRDIGITS};
	numberVar dDecimalPrice;
	numberVar dPos := 1;
	if (dPrice < 0) then
	   dPos := 0;
	if (dPrice < 0) then
	   dPrice := Abs(dPrice);
	dDecimalPrice := 0;
	if (nDigits = 1) then
	   dDecimalPrice :=Abs( Round(10 * ((dPrice / 10) - Truncate(dPrice / 10))));
	if (nDigits = 1) then
	   dPrice := dPrice / 10;
	if (nDigits = 2) then
	   dDecimalPrice := Abs(Round(100 * ((dPrice / 100) - Truncate(dPrice / 100))));
	if (nDigits = 2) then
	   dPrice := dPrice / 100;
	if (nDigits = 3) then
	   dDecimalPrice := Abs(Round(1000 * ((dPrice / 1000) - Truncate(dPrice / 1000))));
	if (nDigits = 3) then
	   dPrice := dPrice / 1000;
	if (nDigits = 4) then
	   dDecimalPrice := Abs(Round(10000 * ((dPrice / 10000) - Truncate(dPrice / 10000))));
	if (nDigits = 4) then
	   dPrice := dPrice / 10000;
	//
	// Work out how many digits in the result
	//
	dPrice := Truncate(dPrice);
	numberVar nSigDigits := Length(ToText(dPrice,"#"));
	if (nSigDigits > 10) then
	   nSigDigits :=10;
	if (nSigDigits < 1) then
	   nSigDigits := 1;
	//
	// Construct format string - thousands side plus decimal side
	//
	stringVar sActualFormat := sThouFormat[nSigDigits];
	//
	// Carry out the conversion and then determine required format
	//
	stringVar sValue := ToText(dPrice,sActualFormat,0,sThous,sDec);
	if (nDigits <> 0) then
	   sValue := sValue + sDec + ToText(dDecimalPrice, sDecFormat[nDigits+1],0);
	if (dOriginalPrice = 0) then
	   ""
	else if (dPos = 1 And {currencies.ICURRENCY} = 0) then
	     {currencies.SCURRENCY} + sValue
	else if (dPos = 1 And {currencies.ICURRENCY} = 1) then
	     sValue  + {currencies.SCURRENCY}
	else if (dPos = 1 And {currencies.ICURRENCY} = 2) then
	      {currencies.SCURRENCY} + " " + sValue
	else if (dPos = 1 And {currencies.ICURRENCY} = 3) then
	     sValue  + "  " + {currencies.SCURRENCY}
	else if (dPos = 0 And {currencies.INEGCURR} = 0) then
	    "(" + {currencies.SCURRENCY} + sValue + ")"
	else if (dPos = 0 And {currencies.INEGCURR} = 1) then
	    "-" + {currencies.SCURRENCY} + sValue
	else if (dPos = 0 And {currencies.INEGCURR} = 2) then
	    {currencies.SCURRENCY} + "-" + sValue
	else if (dPos = 0 And {currencies.INEGCURR} = 3) then
	    {currencies.SCURRENCY} + sValue + "-"
	else if (dPos = 0 And {currencies.INEGCURR} = 4) then
	    "(" + sValue + {currencies.SCURRENCY} + ")"
	else if (dPos = 0 And {currencies.INEGCURR} = 5) then
	    "-" + sValue + {currencies.SCURRENCY}
	else if (dPos = 0 And {currencies.INEGCURR} = 6) then
	    sValue +"-" + {currencies.SCURRENCY}
	else if (dPos = 0 And {currencies.INEGCURR} = 7) then
	    sValue + {currencies.SCURRENCY} + "-"
	else if (dPos = 0 And {currencies.INEGCURR} = 8) then
	    "-" + sValue + " " + {currencies.SCURRENCY}
	else if (dPos = 0 And {currencies.INEGCURR} = 9) then
	    "-" + {currencies.SCURRENCY} + " " + sValue
	else if (dPos = 0 And {currencies.INEGCURR} = 10) then
	    sValue + " " + {currencies.SCURRENCY} + "-"
	else if (dPos = 0 And {currencies.INEGCURR} = 11) then
	    {currencies.SCURRENCY} + " " + sValue + "-"
	else if (dPos = 0 And {currencies.INEGCURR} = 12) then
	    {currencies.SCURRENCY} + " -" + sValue
	else if (dPos = 0 And {currencies.INEGCURR} = 13) then
	    sValue+ "- "  + {currencies.SCURRENCY}
	else if (dPos = 0 And {currencies.INEGCURR} = 14) then
	    "(" + {currencies.SCURRENCY} + " " + sValue + ")"
	else if (dPos = 0 And {currencies.INEGCURR} = 15) then
	    "(" + sValue + " " + {currencies.SCURRENCY} +")"
	else
	    {@FormatError_ID787}
	

	Name: {@Shipping_ID761}
	Formula: //
	// This is a user defined prompt, the value will normally be set be the application
	//
	"Shipping"
	
	

	Name: {@FormatHandling}
	Formula: Local numberVar dPrice := Round({@dHandlingCost});
	//
	// All of the following code should stay the same
	//
	Local numberVar dOriginalPrice := dPrice;
	Local stringVar array sThouFormat := ["#","##","###","#,###","##,###","###,###","#,###,###","##,###,###","###,###,###","#,###,###,###"];
	Local stringVar array sDecFormat := ["", "0", "00", "000", "0000"];
	Local stringVar sThous := {currencies.SMONTHOUSANDSEP};
	Local stringVar sDec := {currencies.SMONDECIMALSEP};
	Local numberVar nDigits := {currencies.ICURRDIGITS};
	Local numberVar dDecimalPrice;
	Local numberVar dPos := 1;
	if (dPrice < 0) then
	   dPos := 0;
	if (dPrice < 0) then
	   dPrice := Abs(dPrice);
	dDecimalPrice := 0;
	if (nDigits = 1) then
	   dDecimalPrice :=Abs( Round(10 * ((dPrice / 10) - Truncate(dPrice / 10))));
	if (nDigits = 1) then
	   dPrice := dPrice / 10;
	if (nDigits = 2) then
	   dDecimalPrice := Abs(Round(100 * ((dPrice / 100) - Truncate(dPrice / 100))));
	if (nDigits = 2) then
	   dPrice := dPrice / 100;
	if (nDigits = 3) then
	   dDecimalPrice := Abs(Round(1000 * ((dPrice / 1000) - Truncate(dPrice / 1000))));
	if (nDigits = 3) then
	   dPrice := dPrice / 1000;
	if (nDigits = 4) then
	   dDecimalPrice := Abs(Round(10000 * ((dPrice / 10000) - Truncate(dPrice / 10000))));
	if (nDigits = 4) then
	   dPrice := dPrice / 10000;
	//
	// Work out how many digits in the result
	//
	dPrice := Truncate(dPrice);
	Local numberVar nSigDigits := Length(ToText(dPrice,"#"));
	if (nSigDigits > 10) then
	   nSigDigits :=10;
	if (nSigDigits < 1) then
	   nSigDigits := 1;
	//
	// Construct format string - thousands side plus decimal side
	//
	Local stringVar sActualFormat := sThouFormat[nSigDigits];
	//
	// Carry out the conversion and then determine required format
	//
	Local stringVar sValue := ToText(dPrice,sActualFormat,0,sThous,sDec);
	if (nDigits <> 0) then
	   sValue := sValue + sDec + ToText(dDecimalPrice, sDecFormat[nDigits+1],0);
	if (dOriginalPrice = 0) then
	   ""
	else if (dPos = 1 And {currencies.ICURRENCY} = 0) then
	     {currencies.SCURRENCY} + sValue
	else if (dPos = 1 And {currencies.ICURRENCY} = 1) then
	     sValue  + {currencies.SCURRENCY}
	else if (dPos = 1 And {currencies.ICURRENCY} = 2) then
	      {currencies.SCURRENCY} + " " + sValue
	else if (dPos = 1 And {currencies.ICURRENCY} = 3) then
	     sValue  + "  " + {currencies.SCURRENCY}
	else if (dPos = 0 And {currencies.INEGCURR} = 0) then
	    "(" + {currencies.SCURRENCY} + sValue + ")"
	else if (dPos = 0 And {currencies.INEGCURR} = 1) then
	    "-" + {currencies.SCURRENCY} + sValue
	else if (dPos = 0 And {currencies.INEGCURR} = 2) then
	    {currencies.SCURRENCY} + "-" + sValue
	else if (dPos = 0 And {currencies.INEGCURR} = 3) then
	    {currencies.SCURRENCY} + sValue + "-"
	else if (dPos = 0 And {currencies.INEGCURR} = 4) then
	    "(" + sValue + {currencies.SCURRENCY} + ")"
	else if (dPos = 0 And {currencies.INEGCURR} = 5) then
	    "-" + sValue + {currencies.SCURRENCY}
	else if (dPos = 0 And {currencies.INEGCURR} = 6) then
	    sValue +"-" + {currencies.SCURRENCY}
	else if (dPos = 0 And {currencies.INEGCURR} = 7) then
	    sValue + {currencies.SCURRENCY} + "-"
	else if (dPos = 0 And {currencies.INEGCURR} = 8) then
	    "-" + sValue + " " + {currencies.SCURRENCY}
	else if (dPos = 0 And {currencies.INEGCURR} = 9) then
	    "-" + {currencies.SCURRENCY} + " " + sValue
	else if (dPos = 0 And {currencies.INEGCURR} = 10) then
	    sValue + " " + {currencies.SCURRENCY} + "-"
	else if (dPos = 0 And {currencies.INEGCURR} = 11) then
	    {currencies.SCURRENCY} + " " + sValue + "-"
	else if (dPos = 0 And {currencies.INEGCURR} = 12) then
	    {currencies.SCURRENCY} + " -" + sValue
	else if (dPos = 0 And {currencies.INEGCURR} = 13) then
	    sValue+ "- "  + {currencies.SCURRENCY}
	else if (dPos = 0 And {currencies.INEGCURR} = 14) then
	    "(" + {currencies.SCURRENCY} + " " + sValue + ")"
	else if (dPos = 0 And {currencies.INEGCURR} = 15) then
	    "(" + sValue + " " + {currencies.SCURRENCY} +")"
	else
	    {@FormatError_ID787}
	
	

	Name: {@Handling_ID762}
	Formula: //
	// This prompt should be set up in the application to the user defined prompt -1,199
	//
	"Handling"
	

	Name: {@Tax1Cost}
	Formula: //
	// Put the specific field being converted in here
	//
	numberVar dPrice := Round({@Tax1});
	//
	// All of the following code should stay the same
	//
	numberVar dOriginalPrice := dPrice;
	stringVar array sThouFormat := ["#","##","###","#,###","##,###","###,###","#,###,###","##,###,###","###,###,###","#,###,###,###"];
	stringVar array sDecFormat := ["", "0", "00", "000", "0000"];
	stringVar sThous := {currencies.SMONTHOUSANDSEP};
	stringVar sDec := {currencies.SMONDECIMALSEP};
	numberVar nDigits := {currencies.ICURRDIGITS};
	numberVar dDecimalPrice;
	numberVar dPos := 1;
	if (dPrice < 0) then
	   dPos := 0;
	if (dPrice < 0) then
	   dPrice := Abs(dPrice);
	dDecimalPrice := 0;
	if (nDigits = 1) then
	   dDecimalPrice :=Abs( Round(10 * ((dPrice / 10) - Truncate(dPrice / 10))));
	if (nDigits = 1) then
	   dPrice := dPrice / 10;
	if (nDigits = 2) then
	   dDecimalPrice := Abs(Round(100 * ((dPrice / 100) - Truncate(dPrice / 100))));
	if (nDigits = 2) then
	   dPrice := dPrice / 100;
	if (nDigits = 3) then
	   dDecimalPrice := Abs(Round(1000 * ((dPrice / 1000) - Truncate(dPrice / 1000))));
	if (nDigits = 3) then
	   dPrice := dPrice / 1000;
	if (nDigits = 4) then
	   dDecimalPrice := Abs(Round(10000 * ((dPrice / 10000) - Truncate(dPrice / 10000))));
	if (nDigits = 4) then
	   dPrice := dPrice / 10000;
	//
	// Work out how many digits in the result
	//
	dPrice := Truncate(dPrice);
	numberVar nSigDigits := Length(ToText(dPrice,"#"));
	if (nSigDigits > 10) then
	   nSigDigits :=10;
	if (nSigDigits < 1) then
	   nSigDigits := 1;
	//
	// Construct format string - thousands side plus decimal side
	//
	stringVar sActualFormat := sThouFormat[nSigDigits];
	//
	// Carry out the conversion and then determine required format
	//
	stringVar sValue := ToText(dPrice,sActualFormat,0,sThous,sDec);
	if (nDigits <> 0) then
	   sValue := sValue + sDec + ToText(dDecimalPrice, sDecFormat[nDigits+1],0);
	if (dOriginalPrice = 0) then
	   ""
	else if (dPos = 1 And {currencies.ICURRENCY} = 0) then
	     {currencies.SCURRENCY} + sValue
	else if (dPos = 1 And {currencies.ICURRENCY} = 1) then
	     sValue  + {currencies.SCURRENCY}
	else if (dPos = 1 And {currencies.ICURRENCY} = 2) then
	      {currencies.SCURRENCY} + " " + sValue
	else if (dPos = 1 And {currencies.ICURRENCY} = 3) then
	     sValue  + "  " + {currencies.SCURRENCY}
	else if (dPos = 0 And {currencies.INEGCURR} = 0) then
	    "(" + {currencies.SCURRENCY} + sValue + ")"
	else if (dPos = 0 And {currencies.INEGCURR} = 1) then
	    "-" + {currencies.SCURRENCY} + sValue
	else if (dPos = 0 And {currencies.INEGCURR} = 2) then
	    {currencies.SCURRENCY} + "-" + sValue
	else if (dPos = 0 And {currencies.INEGCURR} = 3) then
	    {currencies.SCURRENCY} + sValue + "-"
	else if (dPos = 0 And {currencies.INEGCURR} = 4) then
	    "(" + sValue + {currencies.SCURRENCY} + ")"
	else if (dPos = 0 And {currencies.INEGCURR} = 5) then
	    "-" + sValue + {currencies.SCURRENCY}
	else if (dPos = 0 And {currencies.INEGCURR} = 6) then
	    sValue +"-" + {currencies.SCURRENCY}
	else if (dPos = 0 And {currencies.INEGCURR} = 7) then
	    sValue + {currencies.SCURRENCY} + "-"
	else if (dPos = 0 And {currencies.INEGCURR} = 8) then
	    "-" + sValue + " " + {currencies.SCURRENCY}
	else if (dPos = 0 And {currencies.INEGCURR} = 9) then
	    "-" + {currencies.SCURRENCY} + " " + sValue
	else if (dPos = 0 And {currencies.INEGCURR} = 10) then
	    sValue + " " + {currencies.SCURRENCY} + "-"
	else if (dPos = 0 And {currencies.INEGCURR} = 11) then
	    {currencies.SCURRENCY} + " " + sValue + "-"
	else if (dPos = 0 And {currencies.INEGCURR} = 12) then
	    {currencies.SCURRENCY} + " -" + sValue
	else if (dPos = 0 And {currencies.INEGCURR} = 13) then
	    sValue+ "- "  + {currencies.SCURRENCY}
	else if (dPos = 0 And {currencies.INEGCURR} = 14) then
	    "(" + {currencies.SCURRENCY} + " " + sValue + ")"
	else if (dPos = 0 And {currencies.INEGCURR} = 15) then
	    "(" + sValue + " " + {currencies.SCURRENCY} +")"
	else
	    {@FormatError_ID787}
	

	Name: {@TaxNote_ID763}
	Formula: "Tax note:"

	Name: {@Tax2Cost}
	Formula: //
	// Put the specific field being converted in here
	//
	numberVar dPrice := Round({@Tax2});
	//
	// All of the following code should stay the same
	//
	numberVar dOriginalPrice := dPrice;
	stringVar array sThouFormat := ["#","##","###","#,###","##,###","###,###","#,###,###","##,###,###","###,###,###","#,###,###,###"];
	stringVar array sDecFormat := ["", "0", "00", "000", "0000"];
	stringVar sThous := {currencies.SMONTHOUSANDSEP};
	stringVar sDec := {currencies.SMONDECIMALSEP};
	numberVar nDigits := {currencies.ICURRDIGITS};
	numberVar dDecimalPrice;
	numberVar dPos := 1;
	if (dPrice < 0) then
	   dPos := 0;
	if (dPrice < 0) then
	   dPrice := Abs(dPrice);
	dDecimalPrice := 0;
	if (nDigits = 1) then
	   dDecimalPrice :=Abs( Round(10 * ((dPrice / 10) - Truncate(dPrice / 10))));
	if (nDigits = 1) then
	   dPrice := dPrice / 10;
	if (nDigits = 2) then
	   dDecimalPrice := Abs(Round(100 * ((dPrice / 100) - Truncate(dPrice / 100))));
	if (nDigits = 2) then
	   dPrice := dPrice / 100;
	if (nDigits = 3) then
	   dDecimalPrice := Abs(Round(1000 * ((dPrice / 1000) - Truncate(dPrice / 1000))));
	if (nDigits = 3) then
	   dPrice := dPrice / 1000;
	if (nDigits = 4) then
	   dDecimalPrice := Abs(Round(10000 * ((dPrice / 10000) - Truncate(dPrice / 10000))));
	if (nDigits = 4) then
	   dPrice := dPrice / 10000;
	//
	// Work out how many digits in the result
	//
	dPrice := Truncate(dPrice);
	numberVar nSigDigits := Length(ToText(dPrice,"#"));
	if (nSigDigits > 10) then
	   nSigDigits :=10;
	if (nSigDigits < 1) then
	   nSigDigits := 1;
	//
	// Construct format string - thousands side plus decimal side
	//
	stringVar sActualFormat := sThouFormat[nSigDigits];
	//
	// Carry out the conversion and then determine required format
	//
	stringVar sValue := ToText(dPrice,sActualFormat,0,sThous,sDec);
	if (nDigits <> 0) then
	   sValue := sValue + sDec + ToText(dDecimalPrice, sDecFormat[nDigits+1],0);
	if (dOriginalPrice = 0) then
	   ""
	else if (dPos = 1 And {currencies.ICURRENCY} = 0) then
	     {currencies.SCURRENCY} + sValue
	else if (dPos = 1 And {currencies.ICURRENCY} = 1) then
	     sValue  + {currencies.SCURRENCY}
	else if (dPos = 1 And {currencies.ICURRENCY} = 2) then
	      {currencies.SCURRENCY} + " " + sValue
	else if (dPos = 1 And {currencies.ICURRENCY} = 3) then
	     sValue  + "  " + {currencies.SCURRENCY}
	else if (dPos = 0 And {currencies.INEGCURR} = 0) then
	    "(" + {currencies.SCURRENCY} + sValue + ")"
	else if (dPos = 0 And {currencies.INEGCURR} = 1) then
	    "-" + {currencies.SCURRENCY} + sValue
	else if (dPos = 0 And {currencies.INEGCURR} = 2) then
	    {currencies.SCURRENCY} + "-" + sValue
	else if (dPos = 0 And {currencies.INEGCURR} = 3) then
	    {currencies.SCURRENCY} + sValue + "-"
	else if (dPos = 0 And {currencies.INEGCURR} = 4) then
	    "(" + sValue + {currencies.SCURRENCY} + ")"
	else if (dPos = 0 And {currencies.INEGCURR} = 5) then
	    "-" + sValue + {currencies.SCURRENCY}
	else if (dPos = 0 And {currencies.INEGCURR} = 6) then
	    sValue +"-" + {currencies.SCURRENCY}
	else if (dPos = 0 And {currencies.INEGCURR} = 7) then
	    sValue + {currencies.SCURRENCY} + "-"
	else if (dPos = 0 And {currencies.INEGCURR} = 8) then
	    "-" + sValue + " " + {currencies.SCURRENCY}
	else if (dPos = 0 And {currencies.INEGCURR} = 9) then
	    "-" + {currencies.SCURRENCY} + " " + sValue
	else if (dPos = 0 And {currencies.INEGCURR} = 10) then
	    sValue + " " + {currencies.SCURRENCY} + "-"
	else if (dPos = 0 And {currencies.INEGCURR} = 11) then
	    {currencies.SCURRENCY} + " " + sValue + "-"
	else if (dPos = 0 And {currencies.INEGCURR} = 12) then
	    {currencies.SCURRENCY} + " -" + sValue
	else if (dPos = 0 And {currencies.INEGCURR} = 13) then
	    sValue+ "- "  + {currencies.SCURRENCY}
	else if (dPos = 0 And {currencies.INEGCURR} = 14) then
	    "(" + {currencies.SCURRENCY} + " " + sValue + ")"
	else if (dPos = 0 And {currencies.INEGCURR} = 15) then
	    "(" + sValue + " " + {currencies.SCURRENCY} +")"
	else
	    {@FormatError_ID787}
	

	Name: {@OrderTotalCost}
	Formula: //
	// Put the specific field being converted in here
	//
	numberVar dPrice := Round({Orders.Order Total Cost});
	//
	// All of the following code should stay the same
	//
	numberVar dOriginalPrice := dPrice;
	stringVar array sThouFormat := ["#","##","###","#,###","##,###","###,###","#,###,###","##,###,###","###,###,###","#,###,###,###"];
	stringVar array sDecFormat := ["", "0", "00", "000", "0000"];
	stringVar sThous := {currencies.SMONTHOUSANDSEP};
	stringVar sDec := {currencies.SMONDECIMALSEP};
	numberVar nDigits := {currencies.ICURRDIGITS};
	numberVar dDecimalPrice;
	numberVar dPos := 1;
	if (dPrice < 0) then
	   dPos := 0;
	if (dPrice < 0) then
	   dPrice := Abs(dPrice);
	dDecimalPrice := 0;
	if (nDigits = 1) then
	   dDecimalPrice :=Abs( Round(10 * ((dPrice / 10) - Truncate(dPrice / 10))));
	if (nDigits = 1) then
	   dPrice := dPrice / 10;
	if (nDigits = 2) then
	   dDecimalPrice := Abs(Round(100 * ((dPrice / 100) - Truncate(dPrice / 100))));
	if (nDigits = 2) then
	   dPrice := dPrice / 100;
	if (nDigits = 3) then
	   dDecimalPrice := Abs(Round(1000 * ((dPrice / 1000) - Truncate(dPrice / 1000))));
	if (nDigits = 3) then
	   dPrice := dPrice / 1000;
	if (nDigits = 4) then
	   dDecimalPrice := Abs(Round(10000 * ((dPrice / 10000) - Truncate(dPrice / 10000))));
	if (nDigits = 4) then
	   dPrice := dPrice / 10000;
	//
	// Work out how many digits in the result
	//
	dPrice := Truncate(dPrice);
	numberVar nSigDigits := Length(ToText(dPrice,"#"));
	if (nSigDigits > 10) then
	   nSigDigits :=10;
	if (nSigDigits < 1) then
	   nSigDigits := 1;
	//
	// Construct format string - thousands side plus decimal side
	//
	stringVar sActualFormat := sThouFormat[nSigDigits];
	//
	// Carry out the conversion and then determine required format
	//
	stringVar sValue := ToText(dPrice,sActualFormat,0,sThous,sDec);
	if (nDigits <> 0) then
	   sValue := sValue + sDec + ToText(dDecimalPrice, sDecFormat[nDigits+1],0);
	if (dPos = 1 And {currencies.ICURRENCY} = 0) then
	     {currencies.SCURRENCY} + sValue
	else if (dPos = 1 And {currencies.ICURRENCY} = 1) then
	     sValue  + {currencies.SCURRENCY}
	else if (dPos = 1 And {currencies.ICURRENCY} = 2) then
	      {currencies.SCURRENCY} + " " + sValue
	else if (dPos = 1 And {currencies.ICURRENCY} = 3) then
	     sValue  + "  " + {currencies.SCURRENCY}
	else if (dPos = 0 And {currencies.INEGCURR} = 0) then
	    "(" + {currencies.SCURRENCY} + sValue + ")"
	else if (dPos = 0 And {currencies.INEGCURR} = 1) then
	    "-" + {currencies.SCURRENCY} + sValue
	else if (dPos = 0 And {currencies.INEGCURR} = 2) then
	    {currencies.SCURRENCY} + "-" + sValue
	else if (dPos = 0 And {currencies.INEGCURR} = 3) then
	    {currencies.SCURRENCY} + sValue + "-"
	else if (dPos = 0 And {currencies.INEGCURR} = 4) then
	    "(" + sValue + {currencies.SCURRENCY} + ")"
	else if (dPos = 0 And {currencies.INEGCURR} = 5) then
	    "-" + sValue + {currencies.SCURRENCY}
	else if (dPos = 0 And {currencies.INEGCURR} = 6) then
	    sValue +"-" + {currencies.SCURRENCY}
	else if (dPos = 0 And {currencies.INEGCURR} = 7) then
	    sValue + {currencies.SCURRENCY} + "-"
	else if (dPos = 0 And {currencies.INEGCURR} = 8) then
	    "-" + sValue + " " + {currencies.SCURRENCY}
	else if (dPos = 0 And {currencies.INEGCURR} = 9) then
	    "-" + {currencies.SCURRENCY} + " " + sValue
	else if (dPos = 0 And {currencies.INEGCURR} = 10) then
	    sValue + " " + {currencies.SCURRENCY} + "-"
	else if (dPos = 0 And {currencies.INEGCURR} = 11) then
	    {currencies.SCURRENCY} + " " + sValue + "-"
	else if (dPos = 0 And {currencies.INEGCURR} = 12) then
	    {currencies.SCURRENCY} + " -" + sValue
	else if (dPos = 0 And {currencies.INEGCURR} = 13) then
	    sValue+ "- "  + {currencies.SCURRENCY}
	else if (dPos = 0 And {currencies.INEGCURR} = 14) then
	    "(" + {currencies.SCURRENCY} + " " + sValue + ")"
	else if (dPos = 0 And {currencies.INEGCURR} = 15) then
	    "(" + sValue + " " + {currencies.SCURRENCY} +")"
	else
	    {@FormatError_ID787}
	

	Name: {@Total_ID765}
	Formula: "Total"
	

	Name: {@PaymentNote_ID764}
	Formula: "Payment note:"

	Name: {@AdjustmentMessage}
	Formula: {Orders.Adjustment Message}
	

5.0 Sectional Information

5.1 Page Header Section
	Visible, Keep Together

	Subsection.1 
		Visible, Keep Together, Suppress Blank Sections

		Format Formulas

		Visible: if StrCmp({@IsOrderBCNumber}, "N") = 0 then
   false
else
   true

		
	Subsection.2 
		Visible, Keep Together, Suppress Blank Sections

		Format Formulas

		Visible: if StrCmp({@IsOrderBCNumber}, "N") = 0 then
   true
else
   false

		
	{@OrderNumber}
		String, Visible, Default Alignment, Top Alignment, 
		Keep Together, Expand, Using System Default Formatting, Word Wrap


	{@IsReprint}
		String, Visible, Horizontal Centre Alignment, Top Alignment, 
		Keep Together, Using System Default Formatting, Word Wrap


	{@OrderNo_ID691}
		String, Visible, Right Alignment, Top Alignment, 
		Keep Together, Using System Default Formatting, Word Wrap


	{@OrderBCNumber}
		String, Visible, Left Alignment, Top Alignment, 
		Keep Together, Using System Default Formatting, Word Wrap


	{Orders.Order Number}
		String, Visible, Left Alignment, Top Alignment, 
		Keep Together, Using System Default Formatting, Word Wrap


	{@IsReprint}
		String, Visible, Horizontal Centre Alignment, Top Alignment, 
		Keep Together, Using System Default Formatting, Word Wrap


	{@OrderNo_ID691}
		String, Visible, Right Alignment, Top Alignment, 
		Keep Together, Using System Default Formatting, Word Wrap


5.2 Page Footer Section
	Visible

	PrintDate
		Date, Visible, Right Alignment, Top Alignment, 
		Keep Together, Windows Default Type: Not Using Windows Defaults, Date Order: Day Month Year, Year Type: Long, Month Type: Short Month Name, Day Type: Numeric Day, Leading Day Type: None, First Separator: ' ', Second Separator: ' ', Leading Day Separator: ''


	{@Page_ID2103}
		String, Visible, Left Alignment, Top Alignment, 
		Keep Together, Using System Default Formatting, Word Wrap

	 
		String, Visible, Left Alignment, Top Alignment, 
		Keep Together


	PageNumber
		Numeric, Visible, Left Alignment, Top Alignment, 
		Keep Together, Using System Default Formatting, 
		Leading Minus, 0 Decimal Places, Rounding: 1, 
		Thousands Symbol: ',', Decimal Symbol: '.'

	 
		String, Visible, Left Alignment, Top Alignment, 
		Keep Together


	{@Of_ID2104}
		String, Visible, Left Alignment, Top Alignment, 
		Keep Together, Using System Default Formatting, Word Wrap

	 
		String, Visible, Left Alignment, Top Alignment, 
		Keep Together


	TotalPageCount
		Numeric, Visible, Left Alignment, Top Alignment, 
		Keep Together, Using System Default Formatting, 
		Leading Minus, 0 Decimal Places, Rounding: 1, 
		Thousands Symbol: ',', Decimal Symbol: '.'


5.3 Report Header Section
	Hidden, New Page Before

5.4 Report Footer Section
	Hidden, New Page After

5.5 Details Section
	Visible

	Format Formulas

	New Page After: if (not OnLastRecord()) then
   true
else
   false

	
	Subsection.1 
		Visible, Suppress Blank Sections

	Subsection.2 
		Visible, Suppress Blank Sections

	Subsection.3 
		Visible, Suppress Blank Sections

	Subsection.4 
		Visible, Suppress Blank Sections

	Subsection.5 
		Visible, Suppress Blank Sections

	Subsection.6 
		Visible, Suppress Blank Sections

	Subsection.7 
		Visible, Keep Together, Suppress Blank Sections

		Format Formulas

		Visible: if StrCmp({@IsOrderBCCCNumber}, "N") = 0 then
    false
else
    true

		
	Subsection.8 
		Visible, Keep Together

		Format Formulas

		Visible: if StrCmp({@IsOrderBCCCNumber}, "N") = 0 then
    true
else
    false
		
	Subsection.9 
		Visible, Suppress Blank Sections

		Format Formulas

		Visible: if IsNull({@CC}) then
    true
else
    false
		
	Subsection.10 
		Visible, Suppress Blank Sections

		Format Formulas

		Visible: if IsNull({@CC}) then
    true
else
    false
		
	Subsection.11 
		Visible, Keep Together, Suppress Blank Sections

	Subsection.12 
		Visible, Suppress Blank Sections

	Subsection.13 
		Visible, Suppress Blank Sections

		Format Formulas

		Visible: if IsNull({Orders.How Find Site}) then
   true
else
   false
		
	Subsection.14 
		Visible, Suppress Blank Sections

		Format Formulas

		Visible: if IsNull({Orders.Reason For Purchase}) then
   true
else
   false

		
	Subsection.15 
		Visible, Suppress Blank Sections

		Format Formulas

		Visible: if IsNull({Orders.sUserDefinedGeneral}) then
   true
else
   false

		
	Subsection.16 
		Visible, Suppress Blank Sections

	Subsection.17 
		Visible, Suppress Blank Sections

	Subsection.18 
		Visible, Suppress Blank Sections

	Subsection.19 
		Visible, Suppress Blank Sections

	Subsection.20 
		Visible, Suppress Blank Sections

		Format Formulas

		Visible: if (({Orders.Discount Percent} = 0) or (IsNull({Orders.Discount Percent}))) then
   true
else
   false

		
	Subsection.21 
		Visible, Suppress Blank Sections

		Format Formulas

		Visible: if ({Orders.Shipping Total Cost} = 0 And IsNull({Orders.sUserDefinedShipping})) then
   true
else
   false


		
	Subsection.22 
		Visible, Suppress Blank Sections

		Format Formulas

		Visible: if IsNull ({Orders.dHandlingCost}) OR {Orders.dHandlingCost} = 0 then
    true
else
    false

		
	Subsection.23 
		Visible, Suppress Blank Sections

		Format Formulas

		Visible: if ({@Tax1} <= 0 And IsNull({Orders.sUserDefinedTax})) then
   true
else
   false
		
	Subsection.24 
		Visible, Suppress Blank Sections

		Format Formulas

		Visible: if ({@Tax2} <= 0) then
   true
else
   false

		
	Subsection.25 
		Visible, Suppress Blank Sections

	Subsection.26 
		Visible, Keep Together, Suppress Blank Sections

	Subsection.27 
		Visible, Keep Together

		Format Formulas

		Visible: if {Orders.bTax1UserExempt} = true then
    false
else
    true

		
	Subsection.28 
		Visible, Keep Together

		Format Formulas

		Visible: if {Orders.bTax2UserExempt} = true then
    false
else
    true
		
	Subsection.29 
		Visible, Suppress Blank Sections

	Subsection.30 
		Visible, Suppress Blank Sections

		Format Formulas

		Visible: If IsNull({Orders.Adjustment Message}) then
  true
else
  false
		
	Subsection.31 
		Visible, Keep Together, Reset Page Number After, Print At Bottom of Page

	SetupDetails
		Subreport, Visible, Default Alignment, Top Alignment, 
		Keep Together, Expand


		Subreport begins

		1.0 File Information

			Report File: 		SetupDetails
			Version: 		8.0

		2.0 Record Sort Fields
			A - 		{Setup.Magic number}

		3.0 Group Sort Fields

		4.0 Formulas

		4.1 Record Selection Formula
			

		4.2 Group Selection Formula
			

		4.3 Other Formulas

			Name: {@Fax_ID693}
			Formula: "Fax:"
	

			Name: {@Phone_ID692}
			Formula: "Phone:"
	

			Name: {@Email_ID694}
			Formula: "Email:"
	

			Name: {@WebSite_ID695}
			Formula: "Web site:"
	

		5.0 Sectional Information

		5.1 Report Header Section
			Visible, New Page Before

			Subsection.1 
				Hidden, Keep Together

			Subsection.2 
				Visible, Keep Together

		5.2 Report Footer Section
			Visible, New Page After

			Subsection.1 
				Hidden, Keep Together

			Subsection.2 
				Visible, Keep Together

		5.3 Details Section
			Visible

			Subsection.1 
				Visible, Keep Together, Suppress Blank Sections

			Subsection.2 
				Visible, Keep Together, Suppress Blank Sections

			Subsection.3 
				Visible, Keep Together, Suppress Blank Sections

			Subsection.4 
				Visible, Keep Together, Suppress Blank Sections

				Format Formulas

				Visible		: 		if {@AddressFormat} = "1" then
    false
else
    true

		
			Subsection.5 
				Visible, Keep Together

				Format Formulas

				Visible		: 		if {@AddressFormat} = "2" then
    false
else
    true

		
			Subsection.6 
				Visible, Keep Together, Suppress Blank Sections

			Subsection.7 
				Visible, Keep Together, Suppress Blank Sections

				Format Formulas

				Visible		: 		if {@AddressFormat} = "1" then
    false
else
    true
		
			Subsection.8 
				Visible, Keep Together

			Subsection.9 
				Visible, Keep Together, Suppress Blank Sections

			Subsection.10 
				Visible, Keep Together, Suppress Blank Sections

			{Setup.Company Name}
				String, Visible, Default Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


				Object Format Formulas -
				Visible		: 		

		
			{Setup.Address Line 1}
				String, Visible, Default Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


			{Setup.Address Line 2}
				String, Visible, Default Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


			{Setup.Address Line 3}
				String, Visible, Default Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


			{Setup.Zip/Post Code}
				String, Visible, Left Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap

			{@PostcodeSep}
				String, Visible, Left Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap

			{Setup.Address Line 3}
				String, Visible, Left Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


			{Setup.Address LIne 4}
				String, Visible, Default Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


			{Setup.Zip/Post Code}
				String, Visible, Default Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


			{Setup.Country}
				String, Visible, Default Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


			{Setup.Phone}
				Memo, Visible, Default Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


			{Setup.FAX Number}
				Memo, Visible, Default Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


			{@Fax_ID693}
				String, Visible, Default Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


				Object Format Formulas -
				Visible		: 		if IsNull({Setup.Fax Number}) then
    true
else
    false
		
			{@Phone_ID692}
				String, Visible, Default Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


				Object Format Formulas -
				Visible		: 		if IsNull({Setup.Phone}) then
    true
else
    false
		
			{Setup.Email Address}
				Memo, Visible, Default Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


			{Setup.Web Site Address}
				Memo, Visible, Default Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


			{@Email_ID694}
				String, Visible, Default Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


				Object Format Formulas -
				Visible		: 		if IsNull({Setup.Email Address}) then
    true
else
    false
		
			{@WebSite_ID695}
				String, Visible, Default Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


				Object Format Formulas -
				Visible		: 		if IsNull({Setup.Web Site Address}) then
    true
else
    false
		
		Subreport ends

	
		String, Visible, Left Alignment, Top Alignment, 
		Keep Together



	
		String, Visible, Left Alignment, Top Alignment, 
		Keep Together



	{@DataEntry_ID696}
		String, Visible, Horizontal Centre Alignment, Top Alignment, 
		Keep Together, Expand, Using System Default Formatting, Word Wrap


	{@InvoiceTo_ID697}
		String, Visible, Left Alignment, Top Alignment, 
		Keep Together, Expand, Using System Default Formatting, Word Wrap


	{@DeliverTo_ID698}
		String, Visible, Default Alignment, Top Alignment, 
		Keep Together, Using System Default Formatting, Word Wrap


	Delivery
		Subreport, Visible, Default Alignment, Top Alignment, 
		Keep Together, Expand


		Subreport begins

		1.0 File Information

			Report File: 		Delivery
			Version: 		8.0

		2.0 Record Sort Fields
			A - 		{Orders.Order Sequence Number}

		3.0 Group Sort Fields

		4.0 Formulas

		4.1 Record Selection Formula
			{Orders.Order Sequence Number}={?Pm-Orders.Order Sequence Number}

		4.2 Group Selection Formula
			

		4.3 Other Formulas

			Name: {@BarCodeMaxLength}
			Formula: 16
	

			Name: {@BarCodeFontName}
			Formula: "IDAutomationC39S"
	

			Name: {@BarCodeFontSize}
			Formula: 14
	

			Name: {@Name}
			Formula: if IsNull({Person.Salutation} ) then
			    {Person.Name}
			else
			  Left ({Person.Salutation} + " " + {Person.Name}, 255)
			
	

			Name: {@Phone_ID708}
			Formula: "Phone:"
	

			Name: {@Fax_ID709}
			Formula: "Fax:"
	

			Name: {@Mobile_ID2463}
			Formula: "Mobile:"
	

			Name: {@EMail_ID710}
			Formula: "Email:"
	

			Name: {@UserDef_ID711}
			Formula: "User Defined"
	

			Name: {@OrderBCCustomerName}
			Formula: Dim nMaxLength As Number        'maximum length of bar code lines
			Dim nIndex As Number            'array index
			Dim sArray() As String          'splitted string array
			Dim sDisplayValue As String     'final display value
			Dim sSingleLine As String       'single bar code line
			Dim sCode39 As String           'code 39 formated data
			Dim SingleChar As String        'single character
			Dim nPos As Number              'current position
			
			nMaxLength = {@BarCodeMaxLength} - 2 'limit the bar code length
			sDisplayValue = ""              'initialize the dispaly value           
			sSingleLine = ""
			
			sArray = Split(Trim(UCase({@Name})))
			
			For nIndex = 1 To UBound(sArray) Step 1
			   If Len(sSingleLine + sArray(nIndex)) > nMaxLength Then 'length exceeds the limit so add new line
			      If (Len(sSingleLine) > 1) Then
			         sDisplayValue = sDisplayValue + "("  + sSingleLine + ")" + Chr(13)
			      ElseIf (Len(sSingleLine) = 1) Then
			         sDisplayValue = sDisplayValue + "("  + sSingleLine + "=)" + Chr(13)
			      End If
			      sSingleLine = ""
			      For nPos = 1 To Len(sArray(nIndex)) Step nMaxLength
			         sSingleLine = Trim(Mid(sArray(nIndex), nPos, nMaxLength))
			         If Len(sSingleLine) = nMaxLength Then 
			            sDisplayValue = sDisplayValue + "("  + sSingleLine + ")" + Chr(13)
			            sSingleLine = ""
			         End If
			      Next nPos
			   Else
			      If Len(sSingleLine) = 0 Then
			         sSingleLine = sArray(nIndex) 'append to current line
			      Else
			         sSingleLine = sSingleLine + "=" + sArray(nIndex) 'append to current line
			      End If
			   End If
			Next nIndex
			
			If (Len(sSingleLine) > 1) Then
			   sDisplayValue = sDisplayValue + "("  + sSingleLine + ")"
			ElseIf (Len(sSingleLine) = 1) Then
			   sDisplayValue = sDisplayValue + "("  + sSingleLine + "=)"
			End If
			
			For nPos = 1 To Len(sDisplayValue) Step 1
			   SingleChar = Mid(sDisplayValue, nPos, 1)
			   If SingleChar = " " Then SingleChar = "="
			   sCode39 = sCode39 & SingleChar
			Next nPos
			
			Formula = sCode39

			Name: {@Name}
			Formula: if IsNull({Person.Salutation} ) then
			    {Person.Name}
			else
			  Left ({Person.Salutation} + " " + {Person.Name}, 255)
			
	

			Name: {@OrderBCAddressLine1}
			Formula: Dim nMaxLength As Number        'maximum length of bar code lines
			Dim nIndex As Number            'array index
			Dim sArray() As String          'splitted string array
			Dim sDisplayValue As String     'final display value
			Dim sSingleLine As String       'single bar code line
			Dim sCode39 As String           'code 39 formated data
			Dim SingleChar As String        'single character
			Dim nPos As Number              'current position
			
			nMaxLength = {@BarCodeMaxLength} - 2 'limit the bar code length
			sDisplayValue = ""              'initialize the dispaly value           
			sSingleLine = ""
			
			sArray = Split(Trim(UCase({Person.Address Line 1})))
			
			For nIndex = 1 To UBound(sArray) Step 1
			   If Len(sSingleLine + sArray(nIndex)) > nMaxLength Then 'length exceeds the limit so add new line
			      If (Len(sSingleLine) > 1) Then
			         sDisplayValue = sDisplayValue + "("  + sSingleLine + ")" + Chr(13)
			      ElseIf (Len(sSingleLine) = 1) Then
			         sDisplayValue = sDisplayValue + "("  + sSingleLine + "=)" + Chr(13)
			      End If
			      sSingleLine = ""
			      For nPos = 1 To Len(sArray(nIndex)) Step nMaxLength
			         sSingleLine = Trim(Mid(sArray(nIndex), nPos, nMaxLength))
			         If Len(sSingleLine) = nMaxLength Then 
			            sDisplayValue = sDisplayValue + "("  + sSingleLine + ")" + Chr(13)
			            sSingleLine = ""
			         End If
			      Next nPos
			   Else
			      If Len(sSingleLine) = 0 Then
			         sSingleLine = sArray(nIndex) 'append to current line
			      Else
			         sSingleLine = sSingleLine + "=" + sArray(nIndex) 'append to current line
			      End If
			   End If
			Next nIndex
			
			If (Len(sSingleLine) > 1) Then
			   sDisplayValue = sDisplayValue + "("  + sSingleLine + ")"
			ElseIf (Len(sSingleLine) = 1) Then
			   sDisplayValue = sDisplayValue + "("  + sSingleLine + "=)"
			End If
			
			For nPos = 1 To Len(sDisplayValue) Step 1
			   SingleChar = Mid(sDisplayValue, nPos, 1)
			   If SingleChar = " " Then SingleChar = "="
			   sCode39 = sCode39 & SingleChar
			Next nPos
			
			Formula = sCode39

			Name: {@OrderBCAddressLine2}
			Formula: Dim nMaxLength As Number        'maximum length of bar code lines
			Dim nIndex As Number            'array index
			Dim sArray() As String          'splitted string array
			Dim sDisplayValue As String     'final display value
			Dim sSingleLine As String       'single bar code line
			Dim sCode39 As String           'code 39 formated data
			Dim SingleChar As String        'single character
			Dim nPos As Number              'current position
			
			nMaxLength = {@BarCodeMaxLength} - 2 'limit the bar code length
			sDisplayValue = ""              'initialize the dispaly value           
			sSingleLine = ""
			
			sArray = Split(Trim(UCase({Person.Address Line 2})))
			
			For nIndex = 1 To UBound(sArray) Step 1
			   If Len(sSingleLine + sArray(nIndex)) > nMaxLength Then 'length exceeds the limit so add new line
			      If (Len(sSingleLine) > 1) Then
			         sDisplayValue = sDisplayValue + "("  + sSingleLine + ")" + Chr(13)
			      ElseIf (Len(sSingleLine) = 1) Then
			         sDisplayValue = sDisplayValue + "("  + sSingleLine + "=)" + Chr(13)
			      End If
			      sSingleLine = ""
			      For nPos = 1 To Len(sArray(nIndex)) Step nMaxLength
			         sSingleLine = Trim(Mid(sArray(nIndex), nPos, nMaxLength))
			         If Len(sSingleLine) = nMaxLength Then 
			            sDisplayValue = sDisplayValue + "("  + sSingleLine + ")" + Chr(13)
			            sSingleLine = ""
			         End If
			      Next nPos
			   Else
			      If Len(sSingleLine) = 0 Then
			         sSingleLine = sArray(nIndex) 'append to current line
			      Else
			         sSingleLine = sSingleLine + "=" + sArray(nIndex) 'append to current line
			      End If
			   End If
			Next nIndex
			
			If (Len(sSingleLine) > 1) Then
			   sDisplayValue = sDisplayValue + "("  + sSingleLine + ")"
			ElseIf (Len(sSingleLine) = 1) Then
			   sDisplayValue = sDisplayValue + "("  + sSingleLine + "=)"
			End If
			
			For nPos = 1 To Len(sDisplayValue) Step 1
			   SingleChar = Mid(sDisplayValue, nPos, 1)
			   If SingleChar = " " Then SingleChar = "="
			   sCode39 = sCode39 & SingleChar
			Next nPos
			
			Formula = sCode39

			Name: {@OrderBCAddressLine3}
			Formula: Dim nMaxLength As Number        'maximum length of bar code lines
			Dim nIndex As Number            'array index
			Dim sArray() As String          'splitted string array
			Dim sDisplayValue As String     'final display value
			Dim sSingleLine As String       'single bar code line
			Dim sCode39 As String           'code 39 formated data
			Dim SingleChar As String        'single character
			Dim nPos As Number              'current position
			
			nMaxLength = {@BarCodeMaxLength} - 2 'limit the bar code length
			sDisplayValue = ""              'initialize the dispaly value           
			sSingleLine = ""
			
			sArray = Split(Trim(UCase({Person.Address Line 3})))
			
			For nIndex = 1 To UBound(sArray) Step 1
			   If Len(sSingleLine + sArray(nIndex)) > nMaxLength Then 'length exceeds the limit so add new line
			      If (Len(sSingleLine) > 1) Then
			         sDisplayValue = sDisplayValue + "("  + sSingleLine + ")" + Chr(13)
			      ElseIf (Len(sSingleLine) = 1) Then
			         sDisplayValue = sDisplayValue + "("  + sSingleLine + "=)" + Chr(13)
			      End If
			      sSingleLine = ""
			      For nPos = 1 To Len(sArray(nIndex)) Step nMaxLength
			         sSingleLine = Trim(Mid(sArray(nIndex), nPos, nMaxLength))
			         If Len(sSingleLine) = nMaxLength Then 
			            sDisplayValue = sDisplayValue + "("  + sSingleLine + ")" + Chr(13)
			            sSingleLine = ""
			         End If
			      Next nPos
			   Else
			      If Len(sSingleLine) = 0 Then
			         sSingleLine = sArray(nIndex) 'append to current line
			      Else
			         sSingleLine = sSingleLine + "=" + sArray(nIndex) 'append to current line
			      End If
			   End If
			Next nIndex
			
			If (Len(sSingleLine) > 1) Then
			   sDisplayValue = sDisplayValue + "("  + sSingleLine + ")"
			ElseIf (Len(sSingleLine) = 1) Then
			   sDisplayValue = sDisplayValue + "("  + sSingleLine + "=)"
			End If
			
			For nPos = 1 To Len(sDisplayValue) Step 1
			   SingleChar = Mid(sDisplayValue, nPos, 1)
			   If SingleChar = " " Then SingleChar = "="
			   sCode39 = sCode39 & SingleChar
			Next nPos
			
			Formula = sCode39

			Name: {@OrderBCPostCodeAndAddressLine3}
			Formula: Dim nMaxLength As Number        'maximum length of bar code lines
			Dim nIndex As Number            'array index
			Dim sArray() As String          'splitted string array
			Dim sDisplayValue As String     'final display value
			Dim sSingleLine As String       'single bar code line
			Dim sCode39 As String           'code 39 formated data
			Dim SingleChar As String        'single character
			Dim nPos As Number              'current position
			
			nMaxLength = {@BarCodeMaxLength} - 2 'limit the bar code length
			sDisplayValue = ""              'initialize the dispaly value           
			sSingleLine = ""
			
			sArray = Split(Trim(UCase({Person.Postal Code} + " " + {Person.Address Line 3})))
			
			For nIndex = 1 To UBound(sArray) Step 1
			   If Len(sSingleLine + sArray(nIndex)) > nMaxLength Then 'length exceeds the limit so add new line
			      If (Len(sSingleLine) > 1) Then
			         sDisplayValue = sDisplayValue + "("  + sSingleLine + ")" + Chr(13)
			      ElseIf (Len(sSingleLine) = 1) Then
			         sDisplayValue = sDisplayValue + "("  + sSingleLine + "=)" + Chr(13)
			      End If
			      sSingleLine = ""
			      For nPos = 1 To Len(sArray(nIndex)) Step nMaxLength
			         sSingleLine = Trim(Mid(sArray(nIndex), nPos, nMaxLength))
			         If Len(sSingleLine) = nMaxLength Then 
			            sDisplayValue = sDisplayValue + "("  + sSingleLine + ")" + Chr(13)
			            sSingleLine = ""
			         End If
			      Next nPos
			   Else
			      If Len(sSingleLine) = 0 Then
			         sSingleLine = sArray(nIndex) 'append to current line
			      Else
			         sSingleLine = sSingleLine + "=" + sArray(nIndex) 'append to current line
			      End If
			   End If
			Next nIndex
			
			If (Len(sSingleLine) > 1) Then
			   sDisplayValue = sDisplayValue + "("  + sSingleLine + ")"
			ElseIf (Len(sSingleLine) = 1) Then
			   sDisplayValue = sDisplayValue + "("  + sSingleLine + "=)"
			End If
			
			For nPos = 1 To Len(sDisplayValue) Step 1
			   SingleChar = Mid(sDisplayValue, nPos, 1)
			   If SingleChar = " " Then SingleChar = "="
			   sCode39 = sCode39 & SingleChar
			Next nPos
			
			Formula = sCode39

			Name: {@PostalCodeAndAddressLine3}
			Formula: {Person.Postal Code} + " " + {Person.Address Line 3}
	

			Name: {@OrderBCAddressLine4}
			Formula: Dim nMaxLength As Number        'maximum length of bar code lines
			Dim nIndex As Number            'array index
			Dim sArray() As String          'splitted string array
			Dim sDisplayValue As String     'final display value
			Dim sSingleLine As String       'single bar code line
			Dim sCode39 As String           'code 39 formated data
			Dim SingleChar As String        'single character
			Dim nPos As Number              'current position
			
			nMaxLength = {@BarCodeMaxLength} - 2 'limit the bar code length
			sDisplayValue = ""              'initialize the dispaly value           
			sSingleLine = ""
			
			sArray = Split(Trim(UCase({Person.Address Line 4})))
			
			For nIndex = 1 To UBound(sArray) Step 1
			   If Len(sSingleLine + sArray(nIndex)) > nMaxLength Then 'length exceeds the limit so add new line
			      If (Len(sSingleLine) > 1) Then
			         sDisplayValue = sDisplayValue + "("  + sSingleLine + ")" + Chr(13)
			      ElseIf (Len(sSingleLine) = 1) Then
			         sDisplayValue = sDisplayValue + "("  + sSingleLine + "=)" + Chr(13)
			      End If
			      sSingleLine = ""
			      For nPos = 1 To Len(sArray(nIndex)) Step nMaxLength
			         sSingleLine = Trim(Mid(sArray(nIndex), nPos, nMaxLength))
			         If Len(sSingleLine) = nMaxLength Then 
			            sDisplayValue = sDisplayValue + "("  + sSingleLine + ")" + Chr(13)
			            sSingleLine = ""
			         End If
			      Next nPos
			   Else
			      If Len(sSingleLine) = 0 Then
			         sSingleLine = sArray(nIndex) 'append to current line
			      Else
			         sSingleLine = sSingleLine + "=" + sArray(nIndex) 'append to current line
			      End If
			   End If
			Next nIndex
			
			If (Len(sSingleLine) > 1) Then
			   sDisplayValue = sDisplayValue + "("  + sSingleLine + ")"
			ElseIf (Len(sSingleLine) = 1) Then
			   sDisplayValue = sDisplayValue + "("  + sSingleLine + "=)"
			End If
			
			For nPos = 1 To Len(sDisplayValue) Step 1
			   SingleChar = Mid(sDisplayValue, nPos, 1)
			   If SingleChar = " " Then SingleChar = "="
			   sCode39 = sCode39 & SingleChar
			Next nPos
			
			Formula = sCode39

			Name: {@OrderBCPostCode}
			Formula: Dim nMaxLength As Number        'maximum length of bar code lines
			Dim nIndex As Number            'array index
			Dim sArray() As String          'splitted string array
			Dim sDisplayValue As String     'final display value
			Dim sSingleLine As String       'single bar code line
			Dim sCode39 As String           'code 39 formated data
			Dim SingleChar As String        'single character
			Dim nPos As Number              'current position
			
			nMaxLength = {@BarCodeMaxLength} - 2 'limit the bar code length
			sDisplayValue = ""              'initialize the dispaly value           
			sSingleLine = ""
			
			sArray = Split(Trim(UCase({Person.Postal Code})))
			
			For nIndex = 1 To UBound(sArray) Step 1
			   If Len(sSingleLine + sArray(nIndex)) > nMaxLength Then 'length exceeds the limit so add new line
			      If (Len(sSingleLine) > 1) Then
			         sDisplayValue = sDisplayValue + "("  + sSingleLine + ")" + Chr(13)
			      ElseIf (Len(sSingleLine) = 1) Then
			         sDisplayValue = sDisplayValue + "("  + sSingleLine + "=)" + Chr(13)
			      End If
			      sSingleLine = ""
			      For nPos = 1 To Len(sArray(nIndex)) Step nMaxLength
			         sSingleLine = Trim(Mid(sArray(nIndex), nPos, nMaxLength))
			         If Len(sSingleLine) = nMaxLength Then 
			            sDisplayValue = sDisplayValue + "("  + sSingleLine + ")" + Chr(13)
			            sSingleLine = ""
			         End If
			      Next nPos
			   Else
			      If Len(sSingleLine) = 0 Then
			         sSingleLine = sArray(nIndex) 'append to current line
			      Else
			         sSingleLine = sSingleLine + "=" + sArray(nIndex) 'append to current line
			      End If
			   End If
			Next nIndex
			
			If (Len(sSingleLine) > 1) Then
			   sDisplayValue = sDisplayValue + "("  + sSingleLine + ")"
			ElseIf (Len(sSingleLine) = 1) Then
			   sDisplayValue = sDisplayValue + "("  + sSingleLine + "=)"
			End If
			
			For nPos = 1 To Len(sDisplayValue) Step 1
			   SingleChar = Mid(sDisplayValue, nPos, 1)
			   If SingleChar = " " Then SingleChar = "="
			   sCode39 = sCode39 & SingleChar
			Next nPos
			
			Formula = sCode39

		5.0 Sectional Information

		5.1 Report Header Section
			Hidden, New Page Before

			Subsection.1 
				Hidden, Keep Together

			Subsection.2 
				Visible, Keep Together

		5.2 Report Footer Section
			Hidden, New Page After

			Subsection.1 
				Hidden, Keep Together

			Subsection.2 
				Visible, Keep Together

			{@BarCodeMaxLength}
				Numeric, Visible, Default Alignment, Top Alignment, 
				Keep Together, Using System Default Formatting, 
				Leading Minus, 2 Decimal Places, Rounding: 0.01, 
				Thousands Symbol: ',', Decimal Symbol: '.'


			{@BarCodeFontName}
				String, Visible, Default Alignment, Top Alignment, 
				Keep Together, Using System Default Formatting, Word Wrap


			{@BarCodeFontSize}
				Numeric, Visible, Default Alignment, Top Alignment, 
				Keep Together, Using System Default Formatting, 
				Leading Minus, 2 Decimal Places, Rounding: 0.01, 
				Thousands Symbol: ',', Decimal Symbol: '.'


		5.3 Details Section
			Visible

			Subsection.1 
				Visible, Keep Together, Suppress Blank Sections

			Subsection.2 
				Visible, Keep Together, Suppress Blank Sections

			Subsection.3 
				Visible, Keep Together, Suppress Blank Sections

			Subsection.4 
				Visible, Keep Together, Suppress Blank Sections

			Subsection.5 
				Visible, Keep Together, Suppress Blank Sections

			Subsection.6 
				Visible, Keep Together, Suppress Blank Sections

				Format Formulas

				Visible		: 		if {@AddressFormat} = "1" then
   false
else
   true
		
			Subsection.7 
				Visible, Keep Together, Suppress Blank Sections

				Format Formulas

				Visible		: 		if {@AddressFormat} = "2" then
    false
else
    true
		
			Subsection.8 
				Visible, Keep Together, Suppress Blank Sections

			Subsection.9 
				Visible, Keep Together, Suppress Blank Sections

				Format Formulas

				Visible		: 		if {@AddressFormat} = "1" then
    false
else
    true

		
			Subsection.10 
				Visible, Keep Together, Suppress Blank Sections

			Subsection.11 
				Visible, Keep Together, Suppress Blank Sections

			Subsection.12 
				Visible, Keep Together

				Format Formulas

				Visible		: 		if IsNull({Person.sMobileNumber}) OR {Person.sMobileNumber} = "" then
    true
else
    false

		
			Subsection.13 
				Visible, Keep Together, Suppress Blank Sections

			Subsection.14 
				Visible, Keep Together

				Format Formulas

				Visible		: 		if IsNull({Person.sUserDefined}) Then
    true
else
   false
		
			Subsection.15 
				Visible, Keep Together, Suppress Blank Sections

				Format Formulas

				Visible		: 		if StrCmp({@IsOrderBCCustomerName}, "N") = 0 then
   true
else
   false
		
			Subsection.16 
				Visible, Keep Together, Suppress Blank Sections

				Format Formulas

				Visible		: 		if StrCmp({@IsOrderBCCustomerName}, "N") = 0 then
   true
else
   false
		
			Subsection.17 
				Visible, Keep Together, Suppress Blank Sections

				Format Formulas

				Visible		: 		if StrCmp({@IsOrderBCAddressLines}, "N") = 0 then
   true
else
   false
		
			Subsection.18 
				Visible, Keep Together, Suppress Blank Sections

				Format Formulas

				Visible		: 		if StrCmp({@IsOrderBCAddressLines}, "N") = 0 then
   true
else
   false
		
			Subsection.19 
				Visible, Keep Together, Suppress Blank Sections

				Format Formulas

				Visible		: 		if StrCmp({@IsOrderBCAddressLines}, "N") = 0 then
   true
else
   false
		
			Subsection.20 
				Visible, Keep Together, Suppress Blank Sections

				Format Formulas

				Visible		: 		if StrCmp({@IsOrderBCAddressLines}, "N") = 0 then
   true
else
   false
		
			Subsection.21 
				Visible, Keep Together, Suppress Blank Sections

				Format Formulas

				Visible		: 		if {@AddressFormat} = "1" then
   if StrCmp({@IsOrderBCAddressLines}, "N") = 0 then
      true
   else
      false
else
    true
		
			Subsection.22 
				Visible, Keep Together, Suppress Blank Sections

				Format Formulas

				Visible		: 		if {@AddressFormat} = "1" then
   if StrCmp({@IsOrderBCAddressLines}, "N") = 0 then
      true
   else
      false
else
    true
		
			Subsection.23 
				Visible, Keep Together, Suppress Blank Sections

				Format Formulas

				Visible		: 		if {@AddressFormat} = "2" then
    if StrCmp({@IsOrderBCPostCode}, "N") = 0 then
       true
    else
       false
else
    true
		
			Subsection.24 
				Visible, Keep Together, Suppress Blank Sections

				Format Formulas

				Visible		: 		if {@AddressFormat} = "2" then
    if StrCmp({@IsOrderBCPostCode}, "N") = 0 then
       true
    else
       false
else
    true
		
			Subsection.25 
				Visible, Keep Together, Suppress Blank Sections

				Format Formulas

				Visible		: 		if StrCmp({@IsOrderBCAddressLines}, "N") = 0 then
   true
else
   false

		
			Subsection.26 
				Visible, Keep Together, Suppress Blank Sections

				Format Formulas

				Visible		: 		if StrCmp({@IsOrderBCAddressLines}, "N") = 0 then
   true
else
   false
		
			Subsection.27 
				Visible, Keep Together, Suppress Blank Sections

				Format Formulas

				Visible		: 		if {@AddressFormat} = "1" then
    if StrCmp({@IsOrderBCPostCode}, "N") = 0 then
       true
    else
       false
else
    true

		
			Subsection.28 
				Visible, Keep Together, Suppress Blank Sections

				Format Formulas

				Visible		: 		if {@AddressFormat} = "1" then
    if StrCmp({@IsOrderBCPostCode}, "N") = 0 then
       true
    else
       false
else
    true

		
			{@Name}
				String, Visible, Default Alignment, Top Alignment, 
				Keep Together, Using System Default Formatting, Word Wrap


			{Person.Title}
				String, Visible, Default Alignment, Top Alignment, 
				Keep Together, Using System Default Formatting, Word Wrap


			{Person.Company}
				Memo, Visible, Default Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


			{Person.Address Line 1}
				String, Visible, Default Alignment, Top Alignment, 
				Keep Together, Using System Default Formatting, Word Wrap


			{Person.Address Line 2}
				String, Visible, Default Alignment, Top Alignment, 
				Keep Together, Using System Default Formatting, Word Wrap


			{Person.Address Line 3}
				String, Visible, Default Alignment, Top Alignment, 
				Keep Together, Using System Default Formatting, Word Wrap


			{Person.Postal Code}
				String, Visible, Left Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap

			 
				String, Visible, Left Alignment, Top Alignment, 
				Keep Together, Expand


			{Person.Address Line 3}
				String, Visible, Left Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


			{Person.Address Line 4}
				String, Visible, Default Alignment, Top Alignment, 
				Keep Together, Using System Default Formatting, Word Wrap


			{Person.Postal Code}
				String, Visible, Default Alignment, Top Alignment, 
				Keep Together, Using System Default Formatting, Word Wrap


			{Person.Address Country}
				String, Visible, Default Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


			{Person.Phone Number}
				String, Visible, Default Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


			{Person.FAX Number}
				String, Visible, Default Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


			{@Phone_ID708}
				String, Visible, Left Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


				Object Format Formulas -
				Visible		: 		if IsNull({Person.Phone Number}) then
    true
else
    false
		
			{@Fax_ID709}
				String, Visible, Right Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


				Object Format Formulas -
				Visible		: 		if IsNull({Person.FAX Number}) then
    true
else
    false
		
			{@Mobile_ID2463}
				String, Visible, Left Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


				Object Format Formulas -
				Visible		: 		if (IsNull({Person.Phone Number})) Then
  true
else
  false
		
			{Person.sMobileNumber}
				String, Visible, Default Alignment, Top Alignment, 
				Keep Together, Using System Default Formatting, Word Wrap


			{Person.Email Address}
				String, Visible, Default Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


			{@EMail_ID710}
				String, Visible, Left Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


				Object Format Formulas -
				Visible		: 		if IsNull({Person.Email Address}) then
    true
else
    false
		
			{@UserDef_ID711}
				String, Visible, Default Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


			{Person.sUserDefined}
				Memo, Visible, Default Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


			{@OrderBCCustomerName}
				String, Visible, Default Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


			{@Name}
				String, Visible, Default Alignment, Top Alignment, 
				Keep Together, Using System Default Formatting, Word Wrap


			{@OrderBCAddressLine1}
				String, Visible, Default Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


			{Person.Address Line 1}
				String, Visible, Default Alignment, Top Alignment, 
				Keep Together, Using System Default Formatting, Word Wrap


			{@OrderBCAddressLine2}
				String, Visible, Default Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


			{Person.Address Line 2}
				String, Visible, Default Alignment, Top Alignment, 
				Keep Together, Using System Default Formatting, Word Wrap


			{@OrderBCAddressLine3}
				String, Visible, Default Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


			{Person.Address Line 3}
				String, Visible, Default Alignment, Top Alignment, 
				Keep Together, Using System Default Formatting, Word Wrap


			{@OrderBCPostCodeAndAddressLine3}
				String, Visible, Default Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


			{@PostalCodeAndAddressLine3}
				String, Visible, Default Alignment, Top Alignment, 
				Keep Together, Using System Default Formatting, Word Wrap


			{@OrderBCAddressLine4}
				String, Visible, Default Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


			{Person.Address Line 4}
				String, Visible, Default Alignment, Top Alignment, 
				Keep Together, Using System Default Formatting, Word Wrap


			{@OrderBCPostCode}
				String, Visible, Default Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


			{Person.Postal Code}
				String, Visible, Default Alignment, Top Alignment, 
				Keep Together, Using System Default Formatting, Word Wrap


		Subreport ends

	Customer
		Subreport, Visible, Default Alignment, Top Alignment, 
		Keep Together, Expand


		Subreport begins

		1.0 File Information

			Report File: 		Customer
			Version: 		8.0

		2.0 Record Sort Fields
			A - 		{Orders.Order Sequence Number}

		3.0 Group Sort Fields

		4.0 Formulas

		4.1 Record Selection Formula
			{Orders.Order Sequence Number}={?Pm-Orders.Order Sequence Number}

		4.2 Group Selection Formula
			

		4.3 Other Formulas

			Name: {@AddressFormat}
			Formula: "1"
	

			Name: {@BarCodeMaxLength}
			Formula: 16
	

			Name: {@BarCodeFontName}
			Formula: "IDAutomationC39S"
	

			Name: {@BarCodeFontSize}
			Formula: 14
	

			Name: {@Name}
			Formula: if IsNull({Person.Salutation}) Then
			  {Person.Name}
			else
			  Left({Person.Salutation} + " " + {Person.Name}, 255);
	

			Name: {@Phone_ID699}
			Formula: "Phone:"
	

			Name: {@Fax_ID700}
			Formula: "Fax:"
	

			Name: {@Mobile_ID2462}
			Formula: "Mobile:"
	

			Name: {@EMail_ID701}
			Formula: "Email:"
	

			Name: {@UserDef_ID961}
			Formula: "User defined"

			Name: {@KeepContactPrivate}
			Formula: if {Person.bKeepContactPrivate} Then
			   {@Yes_ID703}
			else
			   {@No_ID704}
	

			Name: {@KeepContactPrivate_ID702}
			Formula: "Keep contact private?"
	

			Name: {@MovingInOneMonth}
			Formula: if {Orders.Movement} then
			    {@Yes_ID706}
			else    
			    {@No_ID707}
	

			Name: {@Moving_ID705}
			Formula: "Moving in one month?"
	

			Name: {@OrderBCCustomerName}
			Formula: Dim nMaxLength As Number        'maximum length of bar code lines
			Dim nIndex As Number            'array index
			Dim sArray() As String          'splitted string array
			Dim sDisplayValue As String     'final display value
			Dim sSingleLine As String       'single bar code line
			Dim sCode39 As String           'code 39 formated data
			Dim SingleChar As String        'single character
			Dim nPos As Number              'current position
			
			nMaxLength = {@BarCodeMaxLength} - 2 'limit the bar code length
			sDisplayValue = ""              'initialize the dispaly value           
			sSingleLine = ""
			
			sArray = Split(Trim(UCase({@Name})))
			
			For nIndex = 1 To UBound(sArray) Step 1
			   If Len(sSingleLine + sArray(nIndex)) > nMaxLength Then 'length exceeds the limit so add new line
			      If (Len(sSingleLine) > 1) Then
			         sDisplayValue = sDisplayValue + "("  + sSingleLine + ")" + Chr(13)
			      ElseIf (Len(sSingleLine) = 1) Then
			         sDisplayValue = sDisplayValue + "("  + sSingleLine + "=)" + Chr(13)
			      End If
			      sSingleLine = ""
			      For nPos = 1 To Len(sArray(nIndex)) Step nMaxLength
			         sSingleLine = Trim(Mid(sArray(nIndex), nPos, nMaxLength))
			         If Len(sSingleLine) = nMaxLength Then 
			            sDisplayValue = sDisplayValue + "("  + sSingleLine + ")" + Chr(13)
			            sSingleLine = ""
			         End If
			      Next nPos
			   Else
			      If Len(sSingleLine) = 0 Then
			         sSingleLine = sArray(nIndex) 'append to current line
			      Else
			         sSingleLine = sSingleLine + "=" + sArray(nIndex) 'append to current line
			      End If
			   End If
			Next nIndex
			
			If (Len(sSingleLine) > 1) Then
			   sDisplayValue = sDisplayValue + "("  + sSingleLine + ")"
			ElseIf (Len(sSingleLine) = 1) Then
			   sDisplayValue = sDisplayValue + "("  + sSingleLine + "=)"
			End If
			
			For nPos = 1 To Len(sDisplayValue) Step 1
			   SingleChar = Mid(sDisplayValue, nPos, 1)
			   If SingleChar = " " Then SingleChar = "="
			   sCode39 = sCode39 & SingleChar
			Next nPos
			
			Formula = sCode39
	

			Name: {@Name}
			Formula: if IsNull({Person.Salutation}) Then
			  {Person.Name}
			else
			  Left({Person.Salutation} + " " + {Person.Name}, 255);
	

			Name: {@OrderBCAddressLine1}
			Formula: Dim nMaxLength As Number        'maximum length of bar code lines
			Dim nIndex As Number            'array index
			Dim sArray() As String          'splitted string array
			Dim sDisplayValue As String     'final display value
			Dim sSingleLine As String       'single bar code line
			Dim sCode39 As String           'code 39 formated data
			Dim SingleChar As String        'single character
			Dim nPos As Number              'current position
			
			nMaxLength = {@BarCodeMaxLength} - 2 'limit the bar code length
			sDisplayValue = ""              'initialize the dispaly value           
			sSingleLine = ""
			
			sArray = Split(Trim(UCase({Person.Address Line 1})))
			
			For nIndex = 1 To UBound(sArray) Step 1
			   If Len(sSingleLine + sArray(nIndex)) > nMaxLength Then 'length exceeds the limit so add new line
			      If (Len(sSingleLine) > 1) Then
			         sDisplayValue = sDisplayValue + "("  + sSingleLine + ")" + Chr(13)
			      ElseIf (Len(sSingleLine) = 1) Then
			         sDisplayValue = sDisplayValue + "("  + sSingleLine + "=)" + Chr(13)
			      End If
			      sSingleLine = ""
			      For nPos = 1 To Len(sArray(nIndex)) Step nMaxLength
			         sSingleLine = Trim(Mid(sArray(nIndex), nPos, nMaxLength))
			         If Len(sSingleLine) = nMaxLength Then 
			            sDisplayValue = sDisplayValue + "("  + sSingleLine + ")" + Chr(13)
			            sSingleLine = ""
			         End If
			      Next nPos
			   Else
			      If Len(sSingleLine) = 0 Then
			         sSingleLine = sArray(nIndex) 'append to current line
			      Else
			         sSingleLine = sSingleLine + "=" + sArray(nIndex) 'append to current line
			      End If
			   End If
			Next nIndex
			
			If (Len(sSingleLine) > 1) Then
			   sDisplayValue = sDisplayValue + "("  + sSingleLine + ")"
			ElseIf (Len(sSingleLine) = 1) Then
			   sDisplayValue = sDisplayValue + "("  + sSingleLine + "=)"
			End If
			
			For nPos = 1 To Len(sDisplayValue) Step 1
			   SingleChar = Mid(sDisplayValue, nPos, 1)
			   If SingleChar = " " Then SingleChar = "="
			   sCode39 = sCode39 & SingleChar
			Next nPos
			
			Formula = sCode39

			Name: {@OrderBCAddressLine2}
			Formula: Dim nMaxLength As Number        'maximum length of bar code lines
			Dim nIndex As Number            'array index
			Dim sArray() As String          'splitted string array
			Dim sDisplayValue As String     'final display value
			Dim sSingleLine As String       'single bar code line
			Dim sCode39 As String           'code 39 formated data
			Dim SingleChar As String        'single character
			Dim nPos As Number              'current position
			
			nMaxLength = {@BarCodeMaxLength} - 2 'limit the bar code length
			sDisplayValue = ""              'initialize the dispaly value           
			sSingleLine = ""
			
			sArray = Split(Trim(UCase({Person.Address Line 2})))
			
			For nIndex = 1 To UBound(sArray) Step 1
			   If Len(sSingleLine + sArray(nIndex)) > nMaxLength Then 'length exceeds the limit so add new line
			      If (Len(sSingleLine) > 1) Then
			         sDisplayValue = sDisplayValue + "("  + sSingleLine + ")" + Chr(13)
			      ElseIf (Len(sSingleLine) = 1) Then
			         sDisplayValue = sDisplayValue + "("  + sSingleLine + "=)" + Chr(13)
			      End If
			      sSingleLine = ""
			      For nPos = 1 To Len(sArray(nIndex)) Step nMaxLength
			         sSingleLine = Trim(Mid(sArray(nIndex), nPos, nMaxLength))
			         If Len(sSingleLine) = nMaxLength Then 
			            sDisplayValue = sDisplayValue + "("  + sSingleLine + ")" + Chr(13)
			            sSingleLine = ""
			         End If
			      Next nPos
			   Else
			      If Len(sSingleLine) = 0 Then
			         sSingleLine = sArray(nIndex) 'append to current line
			      Else
			         sSingleLine = sSingleLine + "=" + sArray(nIndex) 'append to current line
			      End If
			   End If
			Next nIndex
			
			If (Len(sSingleLine) > 1) Then
			   sDisplayValue = sDisplayValue + "("  + sSingleLine + ")"
			ElseIf (Len(sSingleLine) = 1) Then
			   sDisplayValue = sDisplayValue + "("  + sSingleLine + "=)"
			End If
			
			For nPos = 1 To Len(sDisplayValue) Step 1
			   SingleChar = Mid(sDisplayValue, nPos, 1)
			   If SingleChar = " " Then SingleChar = "="
			   sCode39 = sCode39 & SingleChar
			Next nPos
			
			Formula = sCode39

			Name: {@OrderBCAddressLine3}
			Formula: Dim nMaxLength As Number        'maximum length of bar code lines
			Dim nIndex As Number            'array index
			Dim sArray() As String          'splitted string array
			Dim sDisplayValue As String     'final display value
			Dim sSingleLine As String       'single bar code line
			Dim sCode39 As String           'code 39 formated data
			Dim SingleChar As String        'single character
			Dim nPos As Number              'current position
			
			nMaxLength = {@BarCodeMaxLength} - 2 'limit the bar code length
			sDisplayValue = ""              'initialize the dispaly value           
			sSingleLine = ""
			
			sArray = Split(Trim(UCase({Person.Address Line 3})))
			
			For nIndex = 1 To UBound(sArray) Step 1
			   If Len(sSingleLine + sArray(nIndex)) > nMaxLength Then 'length exceeds the limit so add new line
			      If (Len(sSingleLine) > 1) Then
			         sDisplayValue = sDisplayValue + "("  + sSingleLine + ")" + Chr(13)
			      ElseIf (Len(sSingleLine) = 1) Then
			         sDisplayValue = sDisplayValue + "("  + sSingleLine + "=)" + Chr(13)
			      End If
			      sSingleLine = ""
			      For nPos = 1 To Len(sArray(nIndex)) Step nMaxLength
			         sSingleLine = Trim(Mid(sArray(nIndex), nPos, nMaxLength))
			         If Len(sSingleLine) = nMaxLength Then 
			            sDisplayValue = sDisplayValue + "("  + sSingleLine + ")" + Chr(13)
			            sSingleLine = ""
			         End If
			      Next nPos
			   Else
			      If Len(sSingleLine) = 0 Then
			         sSingleLine = sArray(nIndex) 'append to current line
			      Else
			         sSingleLine = sSingleLine + "=" + sArray(nIndex) 'append to current line
			      End If
			   End If
			Next nIndex
			
			If (Len(sSingleLine) > 1) Then
			   sDisplayValue = sDisplayValue + "("  + sSingleLine + ")"
			ElseIf (Len(sSingleLine) = 1) Then
			   sDisplayValue = sDisplayValue + "("  + sSingleLine + "=)"
			End If
			
			For nPos = 1 To Len(sDisplayValue) Step 1
			   SingleChar = Mid(sDisplayValue, nPos, 1)
			   If SingleChar = " " Then SingleChar = "="
			   sCode39 = sCode39 & SingleChar
			Next nPos
			
			Formula = sCode39

			Name: {@OrderBCPostCodeAndAddressLine3}
			Formula: Dim nMaxLength As Number        'maximum length of bar code lines
			Dim nIndex As Number            'array index
			Dim sArray() As String          'splitted string array
			Dim sDisplayValue As String     'final display value
			Dim sSingleLine As String       'single bar code line
			Dim sCode39 As String           'code 39 formated data
			Dim SingleChar As String        'single character
			Dim nPos As Number              'current position
			
			nMaxLength = {@BarCodeMaxLength} - 2 'limit the bar code length
			sDisplayValue = ""              'initialize the dispaly value           
			sSingleLine = ""
			
			sArray = Split(Trim(UCase({Person.Postal Code} + " " + {Person.Address Line 3})))
			
			For nIndex = 1 To UBound(sArray) Step 1
			   If Len(sSingleLine + sArray(nIndex)) > nMaxLength Then 'length exceeds the limit so add new line
			      If (Len(sSingleLine) > 1) Then
			         sDisplayValue = sDisplayValue + "("  + sSingleLine + ")" + Chr(13)
			      ElseIf (Len(sSingleLine) = 1) Then
			         sDisplayValue = sDisplayValue + "("  + sSingleLine + "=)" + Chr(13)
			      End If
			      sSingleLine = ""
			      For nPos = 1 To Len(sArray(nIndex)) Step nMaxLength
			         sSingleLine = Trim(Mid(sArray(nIndex), nPos, nMaxLength))
			         If Len(sSingleLine) = nMaxLength Then 
			            sDisplayValue = sDisplayValue + "("  + sSingleLine + ")" + Chr(13)
			            sSingleLine = ""
			         End If
			      Next nPos
			   Else
			      If Len(sSingleLine) = 0 Then
			         sSingleLine = sArray(nIndex) 'append to current line
			      Else
			         sSingleLine = sSingleLine + "=" + sArray(nIndex) 'append to current line
			      End If
			   End If
			Next nIndex
			
			If (Len(sSingleLine) > 1) Then
			   sDisplayValue = sDisplayValue + "("  + sSingleLine + ")"
			ElseIf (Len(sSingleLine) = 1) Then
			   sDisplayValue = sDisplayValue + "("  + sSingleLine + "=)"
			End If
			
			For nPos = 1 To Len(sDisplayValue) Step 1
			   SingleChar = Mid(sDisplayValue, nPos, 1)
			   If SingleChar = " " Then SingleChar = "="
			   sCode39 = sCode39 & SingleChar
			Next nPos
			
			Formula = sCode39

			Name: {@PostalCodeAndAddressLine3}
			Formula: {Person.Postal Code} + " " + {Person.Address Line 3}
	

			Name: {@OrderBCAddressLine4}
			Formula: Dim nMaxLength As Number        'maximum length of bar code lines
			Dim nIndex As Number            'array index
			Dim sArray() As String          'splitted string array
			Dim sDisplayValue As String     'final display value
			Dim sSingleLine As String       'single bar code line
			Dim sCode39 As String           'code 39 formated data
			Dim SingleChar As String        'single character
			Dim nPos As Number              'current position
			
			nMaxLength = {@BarCodeMaxLength} - 2 'limit the bar code length
			sDisplayValue = ""              'initialize the dispaly value           
			sSingleLine = ""
			
			sArray = Split(Trim(UCase({Person.Address Line 4})))
			
			For nIndex = 1 To UBound(sArray) Step 1
			   If Len(sSingleLine + sArray(nIndex)) > nMaxLength Then 'length exceeds the limit so add new line
			      If (Len(sSingleLine) > 1) Then
			         sDisplayValue = sDisplayValue + "("  + sSingleLine + ")" + Chr(13)
			      ElseIf (Len(sSingleLine) = 1) Then
			         sDisplayValue = sDisplayValue + "("  + sSingleLine + "=)" + Chr(13)
			      End If
			      sSingleLine = ""
			      For nPos = 1 To Len(sArray(nIndex)) Step nMaxLength
			         sSingleLine = Trim(Mid(sArray(nIndex), nPos, nMaxLength))
			         If Len(sSingleLine) = nMaxLength Then 
			            sDisplayValue = sDisplayValue + "("  + sSingleLine + ")" + Chr(13)
			            sSingleLine = ""
			         End If
			      Next nPos
			   Else
			      If Len(sSingleLine) = 0 Then
			         sSingleLine = sArray(nIndex) 'append to current line
			      Else
			         sSingleLine = sSingleLine + "=" + sArray(nIndex) 'append to current line
			      End If
			   End If
			Next nIndex
			
			If (Len(sSingleLine) > 1) Then
			   sDisplayValue = sDisplayValue + "("  + sSingleLine + ")"
			ElseIf (Len(sSingleLine) = 1) Then
			   sDisplayValue = sDisplayValue + "("  + sSingleLine + "=)"
			End If
			
			For nPos = 1 To Len(sDisplayValue) Step 1
			   SingleChar = Mid(sDisplayValue, nPos, 1)
			   If SingleChar = " " Then SingleChar = "="
			   sCode39 = sCode39 & SingleChar
			Next nPos
			
			Formula = sCode39

			Name: {@OrderBCPostCode}
			Formula: Dim nMaxLength As Number        'maximum length of bar code lines
			Dim nIndex As Number            'array index
			Dim sArray() As String          'splitted string array
			Dim sDisplayValue As String     'final display value
			Dim sSingleLine As String       'single bar code line
			Dim sCode39 As String           'code 39 formated data
			Dim SingleChar As String        'single character
			Dim nPos As Number              'current position
			
			nMaxLength = {@BarCodeMaxLength} - 2 'limit the bar code length
			sDisplayValue = ""              'initialize the dispaly value           
			sSingleLine = ""
			
			sArray = Split(Trim(UCase({Person.Postal Code})))
			
			For nIndex = 1 To UBound(sArray) Step 1
			   If Len(sSingleLine + sArray(nIndex)) > nMaxLength Then 'length exceeds the limit so add new line
			      If (Len(sSingleLine) > 1) Then
			         sDisplayValue = sDisplayValue + "("  + sSingleLine + ")" + Chr(13)
			      ElseIf (Len(sSingleLine) = 1) Then
			         sDisplayValue = sDisplayValue + "("  + sSingleLine + "=)" + Chr(13)
			      End If
			      sSingleLine = ""
			      For nPos = 1 To Len(sArray(nIndex)) Step nMaxLength
			         sSingleLine = Trim(Mid(sArray(nIndex), nPos, nMaxLength))
			         If Len(sSingleLine) = nMaxLength Then 
			            sDisplayValue = sDisplayValue + "("  + sSingleLine + ")" + Chr(13)
			            sSingleLine = ""
			         End If
			      Next nPos
			   Else
			      If Len(sSingleLine) = 0 Then
			         sSingleLine = sArray(nIndex) 'append to current line
			      Else
			         sSingleLine = sSingleLine + "=" + sArray(nIndex) 'append to current line
			      End If
			   End If
			Next nIndex
			
			If (Len(sSingleLine) > 1) Then
			   sDisplayValue = sDisplayValue + "("  + sSingleLine + ")"
			ElseIf (Len(sSingleLine) = 1) Then
			   sDisplayValue = sDisplayValue + "("  + sSingleLine + "=)"
			End If
			
			For nPos = 1 To Len(sDisplayValue) Step 1
			   SingleChar = Mid(sDisplayValue, nPos, 1)
			   If SingleChar = " " Then SingleChar = "="
			   sCode39 = sCode39 & SingleChar
			Next nPos
			
			Formula = sCode39

		5.0 Sectional Information

		5.1 Report Header Section
			Hidden, New Page Before

			Subsection.1 
				Hidden, Keep Together

			Subsection.2 
				Hidden, Keep Together, Suppress Blank Sections

		5.2 Report Footer Section
			Hidden, New Page After

			Subsection.1 
				Hidden, Keep Together

			Subsection.2 
				Hidden, Keep Together

			{@AddressFormat}
				String, Visible, Default Alignment, Top Alignment, 
				Keep Together, Using System Default Formatting, Word Wrap


			{@BarCodeMaxLength}
				Numeric, Visible, Default Alignment, Top Alignment, 
				Keep Together, Using System Default Formatting, 
				Leading Minus, 2 Decimal Places, Rounding: 0.01, 
				Thousands Symbol: ',', Decimal Symbol: '.'


			{@BarCodeFontName}
				String, Visible, Default Alignment, Top Alignment, 
				Keep Together, Using System Default Formatting, Word Wrap


			{@BarCodeFontSize}
				Numeric, Visible, Default Alignment, Top Alignment, 
				Keep Together, Using System Default Formatting, 
				Leading Minus, 2 Decimal Places, Rounding: 0.01, 
				Thousands Symbol: ',', Decimal Symbol: '.'


		5.3 Details Section
			Visible

			Subsection.1 
				Visible, Keep Together, Suppress Blank Sections

			Subsection.2 
				Visible, Keep Together, Suppress Blank Sections

			Subsection.3 
				Visible, Keep Together, Suppress Blank Sections

			Subsection.4 
				Visible, Keep Together, Suppress Blank Sections

			Subsection.5 
				Visible, Keep Together, Suppress Blank Sections

			Subsection.6 
				Visible, Keep Together, Suppress Blank Sections

				Format Formulas

				Visible		: 		if {@AddressFormat} = "1" then
    false
else
    true

		
			Subsection.7 
				Visible, Keep Together, Suppress Blank Sections

				Format Formulas

				Visible		: 		if {@AddressFormat} = "2" then
   false
else
    true

		
			Subsection.8 
				Visible, Keep Together, Suppress Blank Sections

			Subsection.9 
				Visible, Keep Together, Suppress Blank Sections

				Format Formulas

				Visible		: 		if {@AddressFormat} = "1" then
    false
else
    true
		
			Subsection.10 
				Visible, Keep Together, Suppress Blank Sections

			Subsection.11 
				Visible, Keep Together, Suppress Blank Sections

			Subsection.12 
				Visible, Keep Together

				Format Formulas

				Visible		: 		if IsNull({Person.sMobileNumber}) OR {Person.sMobileNumber} = "" then
    true
else
    false

		
			Subsection.13 
				Visible, Keep Together, Suppress Blank Sections

			Subsection.14 
				Visible, Keep Together

				Format Formulas

				Visible		: 		if IsNull({Person.sUserDefined}) Then
    true
else
   false
		
			Subsection.15 
				Visible, Keep Together

				Format Formulas

				Visible		: 		if {Person.bKeepContactPrivate} Then
   false
else
  true
		
			Subsection.16 
				Visible, Keep Together

				Format Formulas

				Visible		: 		if {Orders.Movement} Then
   false
else
  true
		
			Subsection.17 
				Visible, Keep Together, Suppress Blank Sections

				Format Formulas

				Visible		: 		if StrCmp({@IsOrderBCCustomerName}, "N") = 0 then
   true
else
   false

		
			Subsection.18 
				Visible, Keep Together, Suppress Blank Sections

				Format Formulas

				Visible		: 		if StrCmp({@IsOrderBCCustomerName}, "N") = 0 then
   true
else
   false

		
			Subsection.19 
				Visible, Keep Together, Suppress Blank Sections

				Format Formulas

				Visible		: 		if StrCmp({@IsOrderBCAddressLines}, "N") = 0 then
   true
else
   false

		
			Subsection.20 
				Visible, Keep Together, Suppress Blank Sections

				Format Formulas

				Visible		: 		if StrCmp({@IsOrderBCAddressLines}, "N") = 0 then
   true
else
   false

		
			Subsection.21 
				Visible, Keep Together, Suppress Blank Sections

				Format Formulas

				Visible		: 		if StrCmp({@IsOrderBCAddressLines}, "N") = 0 then
   true
else
   false

		
			Subsection.22 
				Visible, Keep Together, Suppress Blank Sections

				Format Formulas

				Visible		: 		if StrCmp({@IsOrderBCAddressLines}, "N") = 0 then
   true
else
   false

		
			Subsection.23 
				Visible, Keep Together, Suppress Blank Sections

				Format Formulas

				Visible		: 		if {@AddressFormat} = "1" then
    if StrCmp({@IsOrderBCAddressLines}, "N") = 0 then
       true
    else
       false
else
    true

		
			Subsection.24 
				Visible, Keep Together, Suppress Blank Sections

				Format Formulas

				Visible		: 		if {@AddressFormat} = "1" then
    if StrCmp({@IsOrderBCAddressLines}, "N") = 0 then
       true
    else
       false
else
    true

		
			Subsection.25 
				Visible, Keep Together, Suppress Blank Sections

				Format Formulas

				Visible		: 		if {@AddressFormat} = "2" then
   if StrCmp({@IsOrderBCPostCode}, "N") = 0 then
      true
   else
      false
else
    true

		
			Subsection.26 
				Visible, Keep Together, Suppress Blank Sections

				Format Formulas

				Visible		: 		if {@AddressFormat} = "2" then
   if StrCmp({@IsOrderBCPostCode}, "N") = 0 then
      true
   else
      false
else
    true

		
			Subsection.27 
				Visible, Keep Together, Suppress Blank Sections

				Format Formulas

				Visible		: 		if StrCmp({@IsOrderBCAddressLines}, "N") = 0 then
   true
else
   false
		
			Subsection.28 
				Visible, Keep Together, Suppress Blank Sections

				Format Formulas

				Visible		: 		if StrCmp({@IsOrderBCAddressLines}, "N") = 0 then
   true
else
   false
		
			Subsection.29 
				Visible, Keep Together, Suppress Blank Sections

				Format Formulas

				Visible		: 		if {@AddressFormat} = "1" then
    if StrCmp({@IsOrderBCPostCode}, "N") = 0 then
       true
    else
       false
else
    true
		
			Subsection.30 
				Visible, Keep Together, Suppress Blank Sections

				Format Formulas

				Visible		: 		if {@AddressFormat} = "1" then
    if StrCmp({@IsOrderBCPostCode}, "N") = 0 then
       true
    else
       false
else
    true
		
			{@Name}
				String, Visible, Default Alignment, Top Alignment, 
				Keep Together, Using System Default Formatting, Word Wrap


			{Person.Title}
				String, Visible, Default Alignment, Top Alignment, 
				Keep Together, Using System Default Formatting, Word Wrap


			{Person.Company}
				Memo, Visible, Default Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


			{Person.Address Line 1}
				String, Visible, Default Alignment, Top Alignment, 
				Keep Together, Using System Default Formatting, Word Wrap


			{Person.Address Line 2}
				String, Visible, Default Alignment, Top Alignment, 
				Keep Together, Using System Default Formatting, Word Wrap


			{Person.Address Line 3}
				String, Visible, Default Alignment, Top Alignment, 
				Keep Together, Using System Default Formatting, Word Wrap


			{Person.Postal Code}
				String, Visible, Left Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap

			 
				String, Visible, Left Alignment, Top Alignment, 
				Keep Together, Expand


			{Person.Address Line 3}
				String, Visible, Left Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


			{Person.Address Line 4}
				String, Visible, Default Alignment, Top Alignment, 
				Keep Together, Using System Default Formatting, Word Wrap


			{Person.Postal Code}
				String, Visible, Default Alignment, Top Alignment, 
				Keep Together, Using System Default Formatting, Word Wrap


			{Person.Address Country}
				String, Visible, Default Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


			{Person.Phone Number}
				String, Visible, Default Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


			{Person.FAX Number}
				String, Visible, Default Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


			{@Phone_ID699}
				String, Visible, Default Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


				Object Format Formulas -
				Visible		: 		if IsNull({Person.Phone Number}) then
    true
else
    false
		
			{@Fax_ID700}
				String, Visible, Default Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


				Object Format Formulas -
				Visible		: 		if IsNull({Person.FAX Number}) then
    true
else
    false

		
			{Person.sMobileNumber}
				String, Visible, Default Alignment, Top Alignment, 
				Keep Together, Using System Default Formatting, Word Wrap


			{@Mobile_ID2462}
				String, Visible, Left Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


				Object Format Formulas -
				Visible		: 		if (IsNull({Person.Phone Number})) Then
  true
else
  false
		
			{Person.Email Address}
				String, Visible, Default Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


			{@EMail_ID701}
				String, Visible, Default Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


				Object Format Formulas -
				Visible		: 		if IsNull({Person.Email Address}) then
    true
else
    false
		
			{Person.sUserDefined}
				Memo, Visible, Default Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


			{@UserDef_ID961}
				String, Visible, Default Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


			{@KeepContactPrivate}
				String, Visible, Default Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


			{@KeepContactPrivate_ID702}
				String, Visible, Default Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


			{@MovingInOneMonth}
				String, Visible, Default Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


			{@Moving_ID705}
				String, Visible, Default Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


			{@OrderBCCustomerName}
				String, Visible, Default Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


			{@Name}
				String, Visible, Default Alignment, Top Alignment, 
				Keep Together, Using System Default Formatting, Word Wrap


			{@OrderBCAddressLine1}
				String, Visible, Default Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


			{Person.Address Line 1}
				String, Visible, Default Alignment, Top Alignment, 
				Keep Together, Using System Default Formatting, Word Wrap


			{@OrderBCAddressLine2}
				String, Visible, Default Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


			{Person.Address Line 2}
				String, Visible, Default Alignment, Top Alignment, 
				Keep Together, Using System Default Formatting, Word Wrap


			{@OrderBCAddressLine3}
				String, Visible, Default Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


			{Person.Address Line 3}
				String, Visible, Default Alignment, Top Alignment, 
				Keep Together, Using System Default Formatting, Word Wrap


			{@OrderBCPostCodeAndAddressLine3}
				String, Visible, Default Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


			{@PostalCodeAndAddressLine3}
				String, Visible, Default Alignment, Top Alignment, 
				Keep Together, Using System Default Formatting, Word Wrap


			{@OrderBCAddressLine4}
				String, Visible, Default Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


			{Person.Address Line 4}
				String, Visible, Default Alignment, Top Alignment, 
				Keep Together, Using System Default Formatting, Word Wrap


			{@OrderBCPostCode}
				String, Visible, Default Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


			{Person.Postal Code}
				String, Visible, Default Alignment, Top Alignment, 
				Keep Together, Using System Default Formatting, Word Wrap


		Subreport ends

	{@DateOrdered}
		String, Visible, Default Alignment, Top Alignment, 
		Keep Together, Using System Default Formatting, Word Wrap


	{@DateOrderFinished}
		String, Visible, Default Alignment, Top Alignment, 
		Keep Together, Using System Default Formatting, Word Wrap


	{@DateOrdered_ID712}
		String, Visible, Left Alignment, Top Alignment, 
		Keep Together, Expand, Using System Default Formatting, Word Wrap


	{@DateShipped_ID713}
		String, Visible, Left Alignment, Top Alignment, 
		Keep Together, Expand, Using System Default Formatting, Word Wrap


	{@PaymentStatus}
		String, Visible, Default Alignment, Top Alignment, 
		Keep Together, Expand, Using System Default Formatting, Word Wrap


	{@PaymentMethod_ID714}
		String, Visible, Left Alignment, Top Alignment, 
		Keep Together, Expand, Using System Default Formatting, Word Wrap


	{@PaymentStatus_ID722}
		String, Visible, Left Alignment, Top Alignment, 
		Keep Together, Expand, Using System Default Formatting, Word Wrap


	{PaymentMethods.sPreprocessedMethodName}
		Memo, Visible, Default Alignment, Top Alignment, 
		Keep Together, Expand, Using System Default Formatting, Word Wrap


	{@CardType_ID731}
		String, Visible, Default Alignment, Top Alignment, 
		Keep Together, Using System Default Formatting, Word Wrap


		Object Format Formulas -
		Visible: if IsNull({@CCType}) OR {@CCType} = "" then
    true
else
    false

		
	{@Number_ID732}
		String, Visible, Left Alignment, Top Alignment, 
		Keep Together, Expand, Using System Default Formatting, Word Wrap


		Object Format Formulas -
		Visible: if IsNull({@CC}) then
    true
else
    false

		
	{@CC}
		String, Visible, Default Alignment, Top Alignment, 
		Keep Together, Using System Default Formatting, Word Wrap


	{@CCType}
		String, Visible, Default Alignment, Top Alignment, 
		Keep Together, Using System Default Formatting, Word Wrap


	{@OrderBCCCNumber}
		String, Visible, Left Alignment, Top Alignment, 
		Keep Together, Expand, Using System Default Formatting, Word Wrap


	{@CardType_ID731}
		String, Visible, Default Alignment, Top Alignment, 
		Keep Together, Using System Default Formatting, Word Wrap


		Object Format Formulas -
		Visible: if IsNull({@CC}) OR {@CCType} = "" then
    true
else
    false

		
	{@Number_ID732}
		String, Visible, Left Alignment, Top Alignment, 
		Keep Together, Expand, Using System Default Formatting, Word Wrap


		Object Format Formulas -
		Visible: if IsNull({@CC}) then
    true
else
    false

		
	{@CC}
		String, Visible, Default Alignment, Top Alignment, 
		Keep Together, Using System Default Formatting, Word Wrap


	{@CCType}
		String, Visible, Default Alignment, Top Alignment, 
		Keep Together, Using System Default Formatting, Word Wrap


	{@CreditCardIssueNumber}
		String, Visible, Left Alignment, Top Alignment, 
		Keep Together, Expand, Using System Default Formatting, Word Wrap


		Object Format Formulas -
		Visible: if IsNull({@CCIssue}) OR
    {@CCIssue} = "-1" then
    true
else
    false

		
	{@ExpiryDate}
		String, Visible, Default Alignment, Top Alignment, 
		Keep Together, Using System Default Formatting, Word Wrap


		Object Format Formulas -
		Visible: if Not IsNull({@CC}) then
   false
else
  true
		
	{@ExpiryDate_ID734}
		String, Visible, Left Alignment, Top Alignment, 
		Keep Together, Expand, Using System Default Formatting, Word Wrap


		Object Format Formulas -
		Visible: if IsNull({@ExpiryDate}) OR trim({@ExpiryDate}) = "" then
    true
else
    false

		
	{@CVV2_ID1923}
		String, Visible, Default Alignment, Top Alignment, 
		Keep Together, Expand, Using System Default Formatting, Word Wrap


		Object Format Formulas -
		Visible: if {@CVV2} = "-1" then
    true
else
    false

		
	{@CVV2}
		String, Visible, Default Alignment, Top Alignment, 
		Keep Together, Using System Default Formatting, Word Wrap


		Object Format Formulas -
		Visible: if IsNull({@CC}) OR IsNull({@CVV2}) OR {@CVV2} = "-1" then
    true
else
    false
		
	{@StartDate}
		String, Visible, Default Alignment, Top Alignment, 
		Keep Together, Expand, Using System Default Formatting, Word Wrap


	{@StartDate_ID733}
		String, Visible, Left Alignment, Top Alignment, 
		Keep Together, Expand, Using System Default Formatting, Word Wrap


		Object Format Formulas -
		Visible: if IsNull({@StartDate}) OR trim({@StartDate}) = "" then
    true
else
    false
		
	{@CreditCardIssueNumber}
		String, Visible, Left Alignment, Top Alignment, 
		Keep Together, Expand, Using System Default Formatting, Word Wrap


		Object Format Formulas -
		Visible: if IsNull({@CCIssue}) OR
    {@CCIssue} = "-1" then
    true
else
    false

		
	{@IssueNum_ID736}
		String, Visible, Left Alignment, Top Alignment, 
		Keep Together, Expand, Using System Default Formatting, Word Wrap


		Object Format Formulas -
		Visible: if IsNull({@CCIssue}) OR
    {@CCIssue} = "-1" then
    true
else
    false

		
	{@bOrderType}
		String, Visible, Default Alignment, Top Alignment, 
		Keep Together, Expand, Using System Default Formatting, Word Wrap


	{@OrderType_ID2359}
		String, Visible, Default Alignment, Top Alignment, 
		Keep Together, Expand, Using System Default Formatting, Word Wrap


	{@ECI_TYPE}
		String, Visible, Default Alignment, Top Alignment, 
		Keep Together, Expand, Using System Default Formatting, Word Wrap


		Object Format Formulas -
		Visible: if IsNull({@CC}) then
    true
else
    false
		
	{@ECI_ID2313}
		String, Visible, Default Alignment, Top Alignment, 
		Keep Together, Expand, Using System Default Formatting, Word Wrap


		Object Format Formulas -
		Visible: if IsNull({@CC}) then
    true
else
    false
		
	{Orders.PO Number}
		String, Visible, Default Alignment, Top Alignment, 
		Keep Together, Expand, Using System Default Formatting, Word Wrap


	{@ShippingMethod}
		String, Visible, Default Alignment, Top Alignment, 
		Keep Together, Expand, Using System Default Formatting, Word Wrap


	{@PONum_ID737}
		String, Visible, Left Alignment, Top Alignment, 
		Keep Together, Expand, Using System Default Formatting, Word Wrap


	{@ShippingMethod_ID738}
		String, Visible, Left Alignment, Top Alignment, 
		Keep Together, Expand, Using System Default Formatting, Word Wrap


	{Orders.How Find Site}
		String, Visible, Default Alignment, Top Alignment, 
		Keep Together, Expand, Using System Default Formatting, Word Wrap


	{@UserDef1_ID740}
		String, Visible, Left Alignment, Top Alignment, 
		Keep Together, Expand, Using System Default Formatting, Word Wrap


	{Orders.Reason For Purchase}
		String, Visible, Default Alignment, Top Alignment, 
		Keep Together, Expand, Using System Default Formatting, Word Wrap


	{@UserDef2_ID741}
		String, Visible, Left Alignment, Top Alignment, 
		Keep Together, Expand, Using System Default Formatting, Word Wrap


	{Orders.sUserDefinedGeneral}
		String, Visible, Default Alignment, Top Alignment, 
		Keep Together, Expand, Using System Default Formatting, Word Wrap


	{@UserDef3_ID742}
		String, Visible, Left Alignment, Top Alignment, 
		Keep Together, Expand, Using System Default Formatting, Word Wrap


	{Orders.Total Lines}
		Numeric, Visible, Left Alignment, Top Alignment, 
		Keep Together, Using System Default Formatting, 
		Leading Minus, 0 Decimal Places, Rounding: 1, 
		Thousands Symbol: ',', Decimal Symbol: '.'


	{Orders.Total Lines Shipped}
		Numeric, Visible, Left Alignment, Top Alignment, 
		Keep Together, Using System Default Formatting, 
		Leading Minus, 0 Decimal Places, Rounding: 1, 
		Thousands Symbol: ',', Decimal Symbol: '.'


	{Orders.Total Lines Cancelled}
		Numeric, Visible, Left Alignment, Top Alignment, 
		Keep Together, Using System Default Formatting, 
		Leading Minus, 0 Decimal Places, Rounding: 1, 
		Thousands Symbol: ',', Decimal Symbol: '.'


	{Orders.Currency}
		String, Visible, Default Alignment, Top Alignment, 
		Keep Together, Using System Default Formatting, Word Wrap


	{Orders.nTotalLinesBackOrdered}
		Numeric, Visible, Left Alignment, Top Alignment, 
		Keep Together, Using System Default Formatting, 
		Leading Minus, 0 Decimal Places, Rounding: 1, 
		Thousands Symbol: ',', Decimal Symbol: '.'


	{@LinesTotal_ID743}
		String, Visible, Left Alignment, Top Alignment, 
		Keep Together, Expand, Using System Default Formatting, Word Wrap


	{@Shipped_ID744}
		String, Visible, Right Alignment, Top Alignment, 
		Keep Together, Expand, Using System Default Formatting, Word Wrap


	{@Cancelled_ID745}
		String, Visible, Right Alignment, Top Alignment, 
		Keep Together, Expand, Using System Default Formatting, Word Wrap


	{@Backordered_ID746}
		String, Visible, Right Alignment, Top Alignment, 
		Keep Together, Expand, Using System Default Formatting, Word Wrap


	{@Currency_ID747}
		String, Visible, Right Alignment, Top Alignment, 
		Keep Together, Expand, Using System Default Formatting, Word Wrap


	InvoiceDetail
		Subreport, Visible, Default Alignment, Top Alignment, 
, Expand


		Subreport begins

		1.0 File Information

			Report File: 		InvoiceDetail
			Version: 		8.0

		2.0 Record Sort Fields
			A - 		{Orders.Order Sequence Number}
			A - 		{@IsAdjustment}
			A - 		{@DetailOrder}
			A - 		{OrderDetail.bComponentsAsSepOrderLines}
			A - 		{OrderDetail.nSequenceNumber}

		3.0 Group Sort Fields

		4.0 Formulas

		4.1 Record Selection Formula
			{Orders.Order Sequence Number}={?Pm-Orders.Order Sequence Number}


		4.2 Group Selection Formula
			

		4.3 Other Formulas

			Name: {@Code_ID749}
			Formula: "code"
	

			Name: {@Product_ID748}
			Formula: "Product"
	

			Name: {@Description_ID750}
			Formula: "description"
	

			Name: {@QtyOrd_ID751}
			Formula: "Qty ord"
	

			Name: {@QtyShip_ID752}
			Formula: "Qty ship"
	

			Name: {@QtyCan_ID753}
			Formula: "Qty can"
	

			Name: {@QtyBack_ID992}
			Formula: "Qty back"
	

			Name: {@ZeroSharedDiscount}
			Formula: Shared NumberVar dDiscount := 0;
	

			Name: {@UnitPriceTitle}
			Formula: {@UnitPrice_ID754} + " " + {@ExcludingTax_ID2477}
	

			Name: {@TotalCostTitle}
			Formula: {@TotalCost_ID757} + " " + {@ExcludingTax_ID2478}
	

			Name: {@Product_ID748}
			Formula: "Product"
	

			Name: {@Description_ID750}
			Formula: "description"
	

			Name: {@QtyOrd_ID751}
			Formula: "Qty ord"
	

			Name: {@QtyShip_ID752}
			Formula: "Qty ship"
	

			Name: {@QtyCan_ID753}
			Formula: "Qty can"
	

			Name: {@QtyBack_ID992}
			Formula: "Qty back"
	

			Name: {@UnitPriceTitle}
			Formula: {@UnitPrice_ID754} + " " + {@ExcludingTax_ID2477}
	

			Name: {@TotalCostTitle}
			Formula: {@TotalCost_ID757} + " " + {@ExcludingTax_ID2478}
	

			Name: {@Price}
			Formula: //
			// Put the specific field being converted in here
			//
			numberVar dPrice := Round({@ExclusviePrice});
			//
			// All of the following code should stay the same
			//
			numberVar dOriginalPrice := dPrice;
			stringVar array sThouFormat := ["#","##","###","#,###","##,###","###,###","#,###,###","##,###,###","###,###,###","#,###,###,###"];
			stringVar array sDecFormat := ["", "0", "00", "000", "0000"];
			stringVar sThous := {currencies.SMONTHOUSANDSEP};
			stringVar sDec := {currencies.SMONDECIMALSEP};
			numberVar nDigits := {currencies.ICURRDIGITS};
			numberVar dDecimalPrice;
			numberVar dPos := 1;
			if (dPrice < 0) then
			   dPos := 0;
			if (dPrice < 0) then
			   dPrice := Abs(dPrice);
			dDecimalPrice := 0;
			if (nDigits = 1) then
			   dDecimalPrice :=Abs( Round(10 * ((dPrice / 10) - Truncate(dPrice / 10))));
			if (nDigits = 1) then
			   dPrice := dPrice / 10;
			if (nDigits = 2) then
			   dDecimalPrice := Abs(Round(100 * ((dPrice / 100) - Truncate(dPrice / 100))));
			if (nDigits = 2) then
			   dPrice := dPrice / 100;
			if (nDigits = 3) then
			   dDecimalPrice := Abs(Round(1000 * ((dPrice / 1000) - Truncate(dPrice / 1000))));
			if (nDigits = 3) then
			   dPrice := dPrice / 1000;
			if (nDigits = 4) then
			   dDecimalPrice := Abs(Round(10000 * ((dPrice / 10000) - Truncate(dPrice / 10000))));
			if (nDigits = 4) then
			   dPrice := dPrice / 10000;
			//
			// Work out how many digits in the result
			//
			dPrice := Truncate(dPrice);
			numberVar nSigDigits := Length(ToText(dPrice,"#"));
			if (nSigDigits > 10) then
			   nSigDigits :=10;
			if (nSigDigits < 1) then
			   nSigDigits := 1;
			//
			// Construct format string - thousands side plus decimal side
			//
			stringVar sActualFormat := sThouFormat[nSigDigits];
			//
			// Carry out the conversion and then determine required format
			//
			stringVar sValue := ToText(dPrice,sActualFormat,0,sThous,sDec);
			if (nDigits <> 0) then
			   sValue := sValue + sDec + ToText(dDecimalPrice, sDecFormat[nDigits+1],0);
			if (dOriginalPrice = 0) then
			   "0"
			else if (dPos = 1 And {currencies.ICURRENCY} = 0) then
			     {currencies.SCURRENCY} + sValue
			else if (dPos = 1 And {currencies.ICURRENCY} = 1) then
			     sValue  + {currencies.SCURRENCY}
			else if (dPos = 1 And {currencies.ICURRENCY} = 2) then
			      {currencies.SCURRENCY} + " " + sValue
			else if (dPos = 1 And {currencies.ICURRENCY} = 3) then
			     sValue  + "  " + {currencies.SCURRENCY}
			else if (dPos = 0 And {currencies.INEGCURR} = 0) then
			    "(" + {currencies.SCURRENCY} + sValue + ")"
			else if (dPos = 0 And {currencies.INEGCURR} = 1) then
			    "-" + {currencies.SCURRENCY} + sValue
			else if (dPos = 0 And {currencies.INEGCURR} = 2) then
			    {currencies.SCURRENCY} + "-" + sValue
			else if (dPos = 0 And {currencies.INEGCURR} = 3) then
			    {currencies.SCURRENCY} + sValue + "-"
			else if (dPos = 0 And {currencies.INEGCURR} = 4) then
			    "(" + sValue + {currencies.SCURRENCY} + ")"
			else if (dPos = 0 And {currencies.INEGCURR} = 5) then
			    "-" + sValue + {currencies.SCURRENCY}
			else if (dPos = 0 And {currencies.INEGCURR} = 6) then
			    sValue +"-" + {currencies.SCURRENCY}
			else if (dPos = 0 And {currencies.INEGCURR} = 7) then
			    sValue + {currencies.SCURRENCY} + "-"
			else if (dPos = 0 And {currencies.INEGCURR} = 8) then
			    "-" + sValue + " " + {currencies.SCURRENCY}
			else if (dPos = 0 And {currencies.INEGCURR} = 9) then
			    "-" + {currencies.SCURRENCY} + " " + sValue
			else if (dPos = 0 And {currencies.INEGCURR} = 10) then
			    sValue + " " + {currencies.SCURRENCY} + "-"
			else if (dPos = 0 And {currencies.INEGCURR} = 11) then
			    {currencies.SCURRENCY} + " " + sValue + "-"
			else if (dPos = 0 And {currencies.INEGCURR} = 12) then
			    {currencies.SCURRENCY} + " -" + sValue
			else if (dPos = 0 And {currencies.INEGCURR} = 13) then
			    sValue+ "- "  + {currencies.SCURRENCY}
			else if (dPos = 0 And {currencies.INEGCURR} = 14) then
			    "(" + {currencies.SCURRENCY} + " " + sValue + ")"
			else if (dPos = 0 And {currencies.INEGCURR} = 15) then
			    "(" + sValue + " " + {currencies.SCURRENCY} +")"
			else
			      "Format error"

			Name: {@OrderDetailTotalCost}
			Formula: //
			// Put the specific field being converted in here
			//
			numberVar dPrice := Round({@ExclusiveCost});
			//
			// All of the following code should stay the same
			//
			numberVar dOriginalPrice := dPrice;
			stringVar array sThouFormat := ["#","##","###","#,###","##,###","###,###","#,###,###","##,###,###","###,###,###","#,###,###,###"];
			stringVar array sDecFormat := ["", "0", "00", "000", "0000"];
			stringVar sThous := {currencies.SMONTHOUSANDSEP};
			stringVar sDec := {currencies.SMONDECIMALSEP};
			numberVar nDigits := {currencies.ICURRDIGITS};
			numberVar dDecimalPrice;
			numberVar dPos := 1;
			if (dPrice < 0) then
			   dPos := 0;
			if (dPrice < 0) then
			   dPrice := Abs(dPrice);
			dDecimalPrice := 0;
			if (nDigits = 1) then
			   dDecimalPrice :=Abs( Round(10 * ((dPrice / 10) - Truncate(dPrice / 10))));
			if (nDigits = 1) then
			   dPrice := dPrice / 10;
			if (nDigits = 2) then
			   dDecimalPrice := Abs(Round(100 * ((dPrice / 100) - Truncate(dPrice / 100))));
			if (nDigits = 2) then
			   dPrice := dPrice / 100;
			if (nDigits = 3) then
			   dDecimalPrice := Abs(Round(1000 * ((dPrice / 1000) - Truncate(dPrice / 1000))));
			if (nDigits = 3) then
			   dPrice := dPrice / 1000;
			if (nDigits = 4) then
			   dDecimalPrice := Abs(Round(10000 * ((dPrice / 10000) - Truncate(dPrice / 10000))));
			if (nDigits = 4) then
			   dPrice := dPrice / 10000;
			//
			// Work out how many digits in the result
			//
			dPrice := Truncate(dPrice);
			numberVar nSigDigits := Length(ToText(dPrice,"#"));
			if (nSigDigits > 10) then
			   nSigDigits :=10;
			if (nSigDigits < 1) then
			   nSigDigits := 1;
			//
			// Construct format string - thousands side plus decimal side
			//
			stringVar sActualFormat := sThouFormat[nSigDigits];
			//
			// Carry out the conversion and then determine required format
			//
			stringVar sValue := ToText(dPrice,sActualFormat,0,sThous,sDec);
			if (nDigits <> 0) then
			   sValue := sValue + sDec + ToText(dDecimalPrice, sDecFormat[nDigits+1],0);
			if (dOriginalPrice = 0) then
			   "0"
			else if (dPos = 1 And {currencies.ICURRENCY} = 0) then
			     {currencies.SCURRENCY} + sValue
			else if (dPos = 1 And {currencies.ICURRENCY} = 1) then
			     sValue  + {currencies.SCURRENCY}
			else if (dPos = 1 And {currencies.ICURRENCY} = 2) then
			      {currencies.SCURRENCY} + " " + sValue
			else if (dPos = 1 And {currencies.ICURRENCY} = 3) then
			     sValue  + "  " + {currencies.SCURRENCY}
			else if (dPos = 0 And {currencies.INEGCURR} = 0) then
			    "(" + {currencies.SCURRENCY} + sValue + ")"
			else if (dPos = 0 And {currencies.INEGCURR} = 1) then
			    "-" + {currencies.SCURRENCY} + sValue
			else if (dPos = 0 And {currencies.INEGCURR} = 2) then
			    {currencies.SCURRENCY} + "-" + sValue
			else if (dPos = 0 And {currencies.INEGCURR} = 3) then
			    {currencies.SCURRENCY} + sValue + "-"
			else if (dPos = 0 And {currencies.INEGCURR} = 4) then
			    "(" + sValue + {currencies.SCURRENCY} + ")"
			else if (dPos = 0 And {currencies.INEGCURR} = 5) then
			    "-" + sValue + {currencies.SCURRENCY}
			else if (dPos = 0 And {currencies.INEGCURR} = 6) then
			    sValue +"-" + {currencies.SCURRENCY}
			else if (dPos = 0 And {currencies.INEGCURR} = 7) then
			    sValue + {currencies.SCURRENCY} + "-"
			else if (dPos = 0 And {currencies.INEGCURR} = 8) then
			    "-" + sValue + " " + {currencies.SCURRENCY}
			else if (dPos = 0 And {currencies.INEGCURR} = 9) then
			    "-" + {currencies.SCURRENCY} + " " + sValue
			else if (dPos = 0 And {currencies.INEGCURR} = 10) then
			    sValue + " " + {currencies.SCURRENCY} + "-"
			else if (dPos = 0 And {currencies.INEGCURR} = 11) then
			    {currencies.SCURRENCY} + " " + sValue + "-"
			else if (dPos = 0 And {currencies.INEGCURR} = 12) then
			    {currencies.SCURRENCY} + " -" + sValue
			else if (dPos = 0 And {currencies.INEGCURR} = 13) then
			    sValue+ "- "  + {currencies.SCURRENCY}
			else if (dPos = 0 And {currencies.INEGCURR} = 14) then
			    "(" + {currencies.SCURRENCY} + " " + sValue + ")"
			else if (dPos = 0 And {currencies.INEGCURR} = 15) then
			    "(" + sValue + " " + {currencies.SCURRENCY} +")"
			else
			      "Format error"

			Name: {@QuantityBackOrdered}
			Formula: ToText({OrderDetail.nQuantityBackOrdered}, 0, "")
	

			Name: {@QuantityCancelled}
			Formula: ToText({OrderDetail.QuantityCancelled}, 0, "")
	

			Name: {@QuantityShipped}
			Formula: ToText({OrderDetail.QuantityShipped}, 0, "")
	

			Name: {@QuantityOrdered}
			Formula: ToText({OrderDetail.QuantityOrdered}, 0, "")
	

			Name: {@Price}
			Formula: //
			// Put the specific field being converted in here
			//
			numberVar dPrice := Round({@ExclusviePrice});
			//
			// All of the following code should stay the same
			//
			numberVar dOriginalPrice := dPrice;
			stringVar array sThouFormat := ["#","##","###","#,###","##,###","###,###","#,###,###","##,###,###","###,###,###","#,###,###,###"];
			stringVar array sDecFormat := ["", "0", "00", "000", "0000"];
			stringVar sThous := {currencies.SMONTHOUSANDSEP};
			stringVar sDec := {currencies.SMONDECIMALSEP};
			numberVar nDigits := {currencies.ICURRDIGITS};
			numberVar dDecimalPrice;
			numberVar dPos := 1;
			if (dPrice < 0) then
			   dPos := 0;
			if (dPrice < 0) then
			   dPrice := Abs(dPrice);
			dDecimalPrice := 0;
			if (nDigits = 1) then
			   dDecimalPrice :=Abs( Round(10 * ((dPrice / 10) - Truncate(dPrice / 10))));
			if (nDigits = 1) then
			   dPrice := dPrice / 10;
			if (nDigits = 2) then
			   dDecimalPrice := Abs(Round(100 * ((dPrice / 100) - Truncate(dPrice / 100))));
			if (nDigits = 2) then
			   dPrice := dPrice / 100;
			if (nDigits = 3) then
			   dDecimalPrice := Abs(Round(1000 * ((dPrice / 1000) - Truncate(dPrice / 1000))));
			if (nDigits = 3) then
			   dPrice := dPrice / 1000;
			if (nDigits = 4) then
			   dDecimalPrice := Abs(Round(10000 * ((dPrice / 10000) - Truncate(dPrice / 10000))));
			if (nDigits = 4) then
			   dPrice := dPrice / 10000;
			//
			// Work out how many digits in the result
			//
			dPrice := Truncate(dPrice);
			numberVar nSigDigits := Length(ToText(dPrice,"#"));
			if (nSigDigits > 10) then
			   nSigDigits :=10;
			if (nSigDigits < 1) then
			   nSigDigits := 1;
			//
			// Construct format string - thousands side plus decimal side
			//
			stringVar sActualFormat := sThouFormat[nSigDigits];
			//
			// Carry out the conversion and then determine required format
			//
			stringVar sValue := ToText(dPrice,sActualFormat,0,sThous,sDec);
			if (nDigits <> 0) then
			   sValue := sValue + sDec + ToText(dDecimalPrice, sDecFormat[nDigits+1],0);
			if (dOriginalPrice = 0) then
			   "0"
			else if (dPos = 1 And {currencies.ICURRENCY} = 0) then
			     {currencies.SCURRENCY} + sValue
			else if (dPos = 1 And {currencies.ICURRENCY} = 1) then
			     sValue  + {currencies.SCURRENCY}
			else if (dPos = 1 And {currencies.ICURRENCY} = 2) then
			      {currencies.SCURRENCY} + " " + sValue
			else if (dPos = 1 And {currencies.ICURRENCY} = 3) then
			     sValue  + "  " + {currencies.SCURRENCY}
			else if (dPos = 0 And {currencies.INEGCURR} = 0) then
			    "(" + {currencies.SCURRENCY} + sValue + ")"
			else if (dPos = 0 And {currencies.INEGCURR} = 1) then
			    "-" + {currencies.SCURRENCY} + sValue
			else if (dPos = 0 And {currencies.INEGCURR} = 2) then
			    {currencies.SCURRENCY} + "-" + sValue
			else if (dPos = 0 And {currencies.INEGCURR} = 3) then
			    {currencies.SCURRENCY} + sValue + "-"
			else if (dPos = 0 And {currencies.INEGCURR} = 4) then
			    "(" + sValue + {currencies.SCURRENCY} + ")"
			else if (dPos = 0 And {currencies.INEGCURR} = 5) then
			    "-" + sValue + {currencies.SCURRENCY}
			else if (dPos = 0 And {currencies.INEGCURR} = 6) then
			    sValue +"-" + {currencies.SCURRENCY}
			else if (dPos = 0 And {currencies.INEGCURR} = 7) then
			    sValue + {currencies.SCURRENCY} + "-"
			else if (dPos = 0 And {currencies.INEGCURR} = 8) then
			    "-" + sValue + " " + {currencies.SCURRENCY}
			else if (dPos = 0 And {currencies.INEGCURR} = 9) then
			    "-" + {currencies.SCURRENCY} + " " + sValue
			else if (dPos = 0 And {currencies.INEGCURR} = 10) then
			    sValue + " " + {currencies.SCURRENCY} + "-"
			else if (dPos = 0 And {currencies.INEGCURR} = 11) then
			    {currencies.SCURRENCY} + " " + sValue + "-"
			else if (dPos = 0 And {currencies.INEGCURR} = 12) then
			    {currencies.SCURRENCY} + " -" + sValue
			else if (dPos = 0 And {currencies.INEGCURR} = 13) then
			    sValue+ "- "  + {currencies.SCURRENCY}
			else if (dPos = 0 And {currencies.INEGCURR} = 14) then
			    "(" + {currencies.SCURRENCY} + " " + sValue + ")"
			else if (dPos = 0 And {currencies.INEGCURR} = 15) then
			    "(" + sValue + " " + {currencies.SCURRENCY} +")"
			else
			      "Format error"

			Name: {@OrderDetailTotalCost}
			Formula: //
			// Put the specific field being converted in here
			//
			numberVar dPrice := Round({@ExclusiveCost});
			//
			// All of the following code should stay the same
			//
			numberVar dOriginalPrice := dPrice;
			stringVar array sThouFormat := ["#","##","###","#,###","##,###","###,###","#,###,###","##,###,###","###,###,###","#,###,###,###"];
			stringVar array sDecFormat := ["", "0", "00", "000", "0000"];
			stringVar sThous := {currencies.SMONTHOUSANDSEP};
			stringVar sDec := {currencies.SMONDECIMALSEP};
			numberVar nDigits := {currencies.ICURRDIGITS};
			numberVar dDecimalPrice;
			numberVar dPos := 1;
			if (dPrice < 0) then
			   dPos := 0;
			if (dPrice < 0) then
			   dPrice := Abs(dPrice);
			dDecimalPrice := 0;
			if (nDigits = 1) then
			   dDecimalPrice :=Abs( Round(10 * ((dPrice / 10) - Truncate(dPrice / 10))));
			if (nDigits = 1) then
			   dPrice := dPrice / 10;
			if (nDigits = 2) then
			   dDecimalPrice := Abs(Round(100 * ((dPrice / 100) - Truncate(dPrice / 100))));
			if (nDigits = 2) then
			   dPrice := dPrice / 100;
			if (nDigits = 3) then
			   dDecimalPrice := Abs(Round(1000 * ((dPrice / 1000) - Truncate(dPrice / 1000))));
			if (nDigits = 3) then
			   dPrice := dPrice / 1000;
			if (nDigits = 4) then
			   dDecimalPrice := Abs(Round(10000 * ((dPrice / 10000) - Truncate(dPrice / 10000))));
			if (nDigits = 4) then
			   dPrice := dPrice / 10000;
			//
			// Work out how many digits in the result
			//
			dPrice := Truncate(dPrice);
			numberVar nSigDigits := Length(ToText(dPrice,"#"));
			if (nSigDigits > 10) then
			   nSigDigits :=10;
			if (nSigDigits < 1) then
			   nSigDigits := 1;
			//
			// Construct format string - thousands side plus decimal side
			//
			stringVar sActualFormat := sThouFormat[nSigDigits];
			//
			// Carry out the conversion and then determine required format
			//
			stringVar sValue := ToText(dPrice,sActualFormat,0,sThous,sDec);
			if (nDigits <> 0) then
			   sValue := sValue + sDec + ToText(dDecimalPrice, sDecFormat[nDigits+1],0);
			if (dOriginalPrice = 0) then
			   "0"
			else if (dPos = 1 And {currencies.ICURRENCY} = 0) then
			     {currencies.SCURRENCY} + sValue
			else if (dPos = 1 And {currencies.ICURRENCY} = 1) then
			     sValue  + {currencies.SCURRENCY}
			else if (dPos = 1 And {currencies.ICURRENCY} = 2) then
			      {currencies.SCURRENCY} + " " + sValue
			else if (dPos = 1 And {currencies.ICURRENCY} = 3) then
			     sValue  + "  " + {currencies.SCURRENCY}
			else if (dPos = 0 And {currencies.INEGCURR} = 0) then
			    "(" + {currencies.SCURRENCY} + sValue + ")"
			else if (dPos = 0 And {currencies.INEGCURR} = 1) then
			    "-" + {currencies.SCURRENCY} + sValue
			else if (dPos = 0 And {currencies.INEGCURR} = 2) then
			    {currencies.SCURRENCY} + "-" + sValue
			else if (dPos = 0 And {currencies.INEGCURR} = 3) then
			    {currencies.SCURRENCY} + sValue + "-"
			else if (dPos = 0 And {currencies.INEGCURR} = 4) then
			    "(" + sValue + {currencies.SCURRENCY} + ")"
			else if (dPos = 0 And {currencies.INEGCURR} = 5) then
			    "-" + sValue + {currencies.SCURRENCY}
			else if (dPos = 0 And {currencies.INEGCURR} = 6) then
			    sValue +"-" + {currencies.SCURRENCY}
			else if (dPos = 0 And {currencies.INEGCURR} = 7) then
			    sValue + {currencies.SCURRENCY} + "-"
			else if (dPos = 0 And {currencies.INEGCURR} = 8) then
			    "-" + sValue + " " + {currencies.SCURRENCY}
			else if (dPos = 0 And {currencies.INEGCURR} = 9) then
			    "-" + {currencies.SCURRENCY} + " " + sValue
			else if (dPos = 0 And {currencies.INEGCURR} = 10) then
			    sValue + " " + {currencies.SCURRENCY} + "-"
			else if (dPos = 0 And {currencies.INEGCURR} = 11) then
			    {currencies.SCURRENCY} + " " + sValue + "-"
			else if (dPos = 0 And {currencies.INEGCURR} = 12) then
			    {currencies.SCURRENCY} + " -" + sValue
			else if (dPos = 0 And {currencies.INEGCURR} = 13) then
			    sValue+ "- "  + {currencies.SCURRENCY}
			else if (dPos = 0 And {currencies.INEGCURR} = 14) then
			    "(" + {currencies.SCURRENCY} + " " + sValue + ")"
			else if (dPos = 0 And {currencies.INEGCURR} = 15) then
			    "(" + sValue + " " + {currencies.SCURRENCY} +")"
			else
			      "Format error"

			Name: {@QuantityOrdered}
			Formula: ToText({OrderDetail.QuantityOrdered}, 0, "")
	

			Name: {@QuantityShipped}
			Formula: ToText({OrderDetail.QuantityShipped}, 0, "")
	

			Name: {@QuantityCancelled}
			Formula: ToText({OrderDetail.QuantityCancelled}, 0, "")
	

			Name: {@QuantityBackOrdered}
			Formula: ToText({OrderDetail.nQuantityBackOrdered}, 0, "")
	

			Name: {@DiscountG}
			Formula: //
			// Put the specific field being converted in here
			//
			NumberVar dPrice := Round({OrderDetail.TotalCost});
			
			if (Left({OrderDetail.ProductReference}, 5) = ":::::" AND {OrderDetail.Status} <> 'C') then
			    Shared NumberVar dDiscount := dDiscount + dPrice
			else
			    Shared NumberVar dDiscount := dDiscount;
	

			Name: {@DateInput}
			Formula: StringVar sYear := Left({OrderDetail.DateInput},4);
			StringVar sMonth := Mid({OrderDetail.DateInput},6,2);
			StringVar sDay := Mid({OrderDetail.DateInput},9,2); 
			
			
			NumberVar nYear :=  ToNumber(Left({OrderDetail.DateInput},4));
			NumberVar nMonth := ToNumber(Mid({OrderDetail.DateInput},6,2));
			NumberVar nDay := ToNumber(Mid({OrderDetail.DateInput},9,2)); 
			ToText(Date(nYear,nMonth,nDay),"dd MMM yyyy")
			
	

			Name: {@DateInput_ID755}
			Formula: "Date input:"
	

		5.0 Sectional Information

		5.1 Report Header Section
			Visible, New Page Before

			Subsection.1 
				Hidden, Keep Together

			Subsection.2 
				Visible, Keep Together

				Format Formulas

				Visible		: 		if {@UseProductRefsReportParameter} = "Y" then
    false
else
    true

		
			Subsection.3 
				Visible, Keep Together

				Format Formulas

				Visible		: 		if {@UseProductRefsReportParameter} = "Y" then
    true
else
    false

		
			{@Code_ID749}
				String, Visible, Left Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


			{@Product_ID748}
				String, Visible, Left Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


			{@Description_ID750}
				String, Visible, Left Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


			{@QtyOrd_ID751}
				String, Visible, Horizontal Centre Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


			{@QtyShip_ID752}
				String, Visible, Horizontal Centre Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


			{@QtyCan_ID753}
				String, Visible, Horizontal Centre Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


			{@QtyBack_ID992}
				String, Visible, Horizontal Centre Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


			{@ZeroSharedDiscount}
				Numeric, Hidden, Default Alignment, Top Alignment, 
				Keep Together, Using System Default Formatting, 
				Leading Minus, 2 Decimal Places, Rounding: 0.01, 
				Thousands Symbol: ',', Decimal Symbol: '.'


			{@UnitPriceTitle}
				String, Visible, Horizontal Centre Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


			{@TotalCostTitle}
				String, Visible, Horizontal Centre Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


			{@Product_ID748}
				String, Visible, Left Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


			{@Description_ID750}
				String, Visible, Left Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


			{@QtyOrd_ID751}
				String, Visible, Horizontal Centre Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


			{@QtyShip_ID752}
				String, Visible, Horizontal Centre Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


			{@QtyCan_ID753}
				String, Visible, Horizontal Centre Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


			{@QtyBack_ID992}
				String, Visible, Horizontal Centre Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


			{@UnitPriceTitle}
				String, Visible, Horizontal Centre Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


			{@TotalCostTitle}
				String, Visible, Horizontal Centre Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


		5.2 Report Footer Section
			Visible, New Page After

			Subsection.1 
				Visible, Keep Together

			Subsection.2 
				Hidden, Keep Together

		5.3 Details Section
			Visible

			Subsection.1 
				Visible, Keep Together

				Format Formulas

				Visible		: 		if {OrderDetail.bIsComponent} AND Not {OrderDetail.bComponentsAsSepOrderLines} then
    true
else if {OrderDetail.QuantityOrdered} = 0 then
    true
else
    false

		
			Subsection.2 
				Visible, Keep Together

				Format Formulas

				Visible		: 		if ({@UseProductRefsReportParameter} = "N") then
    true
else if ({OrderDetail.bNoOrderLineForMainProduct} AND not({OrderDetail.bComponentsAsSepOrderLines})) then
    true
else if (Left({OrderDetail.ProductReference}, 5) = ":::::" AND {OrderDetail.Status} = 'C') then
    true
else if ({OrderDetail.nLineType} >= 2 AND {OrderDetail.TotalCost} = 0) then
    true
else if ({OrderDetail.Status} = "C")  AND ({OrderDetail.nLineType} = 2) then
    true
else if ({OrderDetail.nLineType} = 0 AND {OrderDetail.QuantityOrdered} = 0) then
    true
else
    false
		
			Subsection.3 
				Visible, Keep Together

				Format Formulas

				Visible		: 		if ({@UseProductRefsReportParameter} = "Y") then
    true
else if ({OrderDetail.bNoOrderLineForMainProduct} AND not({OrderDetail.bComponentsAsSepOrderLines})) then
    true
else if (Left({OrderDetail.ProductReference}, 5) = ":::::" AND {OrderDetail.Status} = 'C') then
    true
else if ({OrderDetail.nLineType} >= 2 AND {OrderDetail.TotalCost} = 0) then
    true
else if ({OrderDetail.Status} = "C")  AND ({OrderDetail.nLineType} = 2) then
    true
else if ({OrderDetail.nLineType} = 0 AND {OrderDetail.QuantityOrdered} = 0) then
    true
else
    false
		
			Subsection.4 
				Visible, Keep Together, Suppress Blank Sections

				Format Formulas

				Visible		: 		

		
			Subsection.5 
				Visible, Keep Together

				Format Formulas

				Visible		: 		if IsNull({OrderDetail.DateInput}) Then
    True
else
    False

		
			Subsection.6 
				Visible, Keep Together

				Format Formulas

				Visible		: 		If IsNull({OrderDetail.InformationInput}) Then
    True
else
    False
		
			Subsection.7 
				Visible, Keep Together, Suppress Blank Sections

				Format Formulas

				Visible		: 		if ({@UseProductRefsReportParameter} = "Y") then
   true
else If IsNull({OrderDetail.sCancelMessage}) OR {OrderDetail.QuantityCancelled} = 0 then
    true
else
    false
		
			Subsection.8 
				Visible, Keep Together, Suppress Blank Sections

				Format Formulas

				Visible		: 		if ({@UseProductRefsReportParameter} = "N") then
   true
else   If IsNull({OrderDetail.sCancelMessage}) OR {OrderDetail.QuantityCancelled} = 0 then
    true
else
    false
		
			{@Price}
				String, Visible, Right Alignment, Top Alignment, 
				Keep Together, Using System Default Formatting, Word Wrap


				Object Format Formulas -
				Visible		: 		if {OrderDetail.QuantityOrdered} = 0 or 
    ({OrderDetail.bIsComponent} AND Not {OrderDetail.bComponentsAsSepOrderLines}) Then
    true
else
    false
		
			{@OrderDetailTotalCost}
				String, Visible, Right Alignment, Top Alignment, 
				Keep Together, Using System Default Formatting, Word Wrap


				Object Format Formulas -
				Visible		: 		if ({OrderDetail.nLineType} >= 2 AND {OrderDetail.TotalCost} <> 0) then 
    false


else if {OrderDetail.QuantityOrdered} = 0 or 
    ({OrderDetail.bIsComponent} AND Not {OrderDetail.bComponentsAsSepOrderLines}) Then
    true
else
    false
		
			{OrderDetail.sProductDescription}
				Memo, Visible, Default Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


			{OrderDetail.ProductReference}
				String, Visible, Default Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


				Object Format Formulas -
				Visible		: 		if Left({OrderDetail.ProductReference}, 5) = ":::::" OR
{OrderDetail.nLineType} = 2 then // if cart discount
    true
else
    false
		
			{@QuantityBackOrdered}
				String, Visible, Right Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


				Object Format Formulas -
				Visible		: 		if IsNull({Orders.Order Sequence Number}) then
    true
else if {OrderDetail.bComponentsAsSepOrderLines} then
    false
else if IsNull({OrderDetail.ProductReference}) OR
   Left({OrderDetail.ProductReference}, 5) = ":::::"  OR
   {OrderDetail.ProductReference} = "" OR
   {OrderDetail.nLineType} = 2 then // if cart discount
    true
else
    false
		
			{@QuantityCancelled}
				String, Visible, Right Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


				Object Format Formulas -
				Visible		: 		if IsNull({Orders.Order Sequence Number}) then
    true
else if {OrderDetail.bComponentsAsSepOrderLines} then
    false
else if IsNull({OrderDetail.ProductReference}) OR
   Left({OrderDetail.ProductReference}, 5) = ":::::"  OR
   {OrderDetail.ProductReference} = "" OR
   {OrderDetail.nLineType} = 2 then // if cart discount
    true
else
    false
		
			{@QuantityShipped}
				String, Visible, Right Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


				Object Format Formulas -
				Visible		: 		if IsNull({Orders.Order Sequence Number}) then
    true
else if {OrderDetail.bComponentsAsSepOrderLines} then
    false
else if IsNull({OrderDetail.ProductReference}) OR
   Left({OrderDetail.ProductReference}, 5) = ":::::"  OR
   {OrderDetail.ProductReference} = "" OR
   {OrderDetail.nLineType} = 2 then // if cart discount
    true
else
    false
		
			{@QuantityOrdered}
				String, Visible, Right Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


				Object Format Formulas -
				Visible		: 		if IsNull({Orders.Order Sequence Number}) then
    true
else if {OrderDetail.bComponentsAsSepOrderLines} then
    false
else if IsNull({OrderDetail.ProductReference}) OR
   Left({OrderDetail.ProductReference}, 5) = ":::::"  OR
   {OrderDetail.ProductReference} = "" OR
   {OrderDetail.nLineType} = 2 then         // if cart discount
    true
else
    false
		
			{@Price}
				String, Visible, Right Alignment, Top Alignment, 
				Keep Together, Using System Default Formatting, Word Wrap


				Object Format Formulas -
				Visible		: 		if {OrderDetail.QuantityOrdered} = 0 or 
    ({OrderDetail.bIsComponent} AND Not {OrderDetail.bComponentsAsSepOrderLines}) Then
    true
else
    false
		
			{@OrderDetailTotalCost}
				String, Visible, Right Alignment, Top Alignment, 
				Keep Together, Using System Default Formatting, Word Wrap


				Object Format Formulas -
				Visible		: 		if ({OrderDetail.nLineType} >= 2 AND {OrderDetail.TotalCost} <> 0) then
    false
else if {OrderDetail.QuantityOrdered} = 0 or 
    ({OrderDetail.bIsComponent} AND Not {OrderDetail.bComponentsAsSepOrderLines}) Then
    true
else
    false
		
			{OrderDetail.sProductDescription}
				Memo, Visible, Default Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


			{@QuantityOrdered}
				String, Visible, Right Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


				Object Format Formulas -
				Visible		: 		if IsNull({Orders.Order Sequence Number}) then
    true
else if {OrderDetail.bComponentsAsSepOrderLines} then
    false
else if IsNull({OrderDetail.ProductReference}) OR
   Left({OrderDetail.ProductReference}, 5) = ":::::"  OR
   {OrderDetail.ProductReference} = "" OR
    {OrderDetail.nLineType} = 2 then         // if cart discount
    true
else
    false
		
			{@QuantityShipped}
				String, Visible, Right Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


				Object Format Formulas -
				Visible		: 		if IsNull({Orders.Order Sequence Number}) then
    true
else if {OrderDetail.bComponentsAsSepOrderLines} then
    false
else if IsNull({OrderDetail.ProductReference}) OR
   Left({OrderDetail.ProductReference}, 5) = ":::::"  OR
   {OrderDetail.ProductReference} = "" OR
    {OrderDetail.nLineType} = 2 then         // if cart discount
    true
else
    false
		
			{@QuantityCancelled}
				String, Visible, Right Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


				Object Format Formulas -
				Visible		: 		if IsNull({Orders.Order Sequence Number}) then
    true
else if {OrderDetail.bComponentsAsSepOrderLines} then
    false
else if IsNull({OrderDetail.ProductReference}) OR
   Left({OrderDetail.ProductReference}, 5) = ":::::"  OR
   {OrderDetail.ProductReference} = "" OR
    {OrderDetail.nLineType} = 2 then         // if cart discount
    true
else
    false
		
			{@QuantityBackOrdered}
				String, Visible, Right Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


				Object Format Formulas -
				Visible		: 		if IsNull({Orders.Order Sequence Number}) then
    true
else if {OrderDetail.bComponentsAsSepOrderLines} then
    false
else if IsNull({OrderDetail.ProductReference}) OR
   Left({OrderDetail.ProductReference}, 5) = ":::::"  OR
   {OrderDetail.ProductReference} = "" OR
    {OrderDetail.nLineType} = 2 then         // if cart discount
    true
else
    false
		
			{OrderDetail.sReportDescription}
				Memo, Visible, Default Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


			{@DiscountG}
				Numeric, Hidden, Default Alignment, Top Alignment, 
				Keep Together, Using System Default Formatting, 
				Leading Minus, 2 Decimal Places, Rounding: 0.01, 
				Thousands Symbol: ',', Decimal Symbol: '.'


			{@DateInput}
				String, Visible, Default Alignment, Top Alignment, 
				Keep Together, Using System Default Formatting, Word Wrap


			{@DateInput_ID755}
				String, Visible, Default Alignment, Top Alignment, 
				Keep Together, Using System Default Formatting, Word Wrap


			{OrderDetail.InformationInput}
				Memo, Visible, Default Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


			{OrderDetail.sInfoPrompt}
				Memo, Visible, Default Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


			{OrderDetail.sCancelMessage}
				String, Visible, Default Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


			{OrderDetail.sCancelMessage}
				String, Visible, Default Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


		Subreport ends

	{@SubTotalCost}
		String, Visible, Right Alignment, Top Alignment, 
		Keep Together, Using System Default Formatting, Word Wrap


	{@Subtotal_ID758}
		String, Visible, Right Alignment, Top Alignment, 
		Keep Together, Expand, Using System Default Formatting, Word Wrap


	{@DiscountCost}
		String, Visible, Right Alignment, Top Alignment, 
		Keep Together, Using System Default Formatting, Word Wrap


		Object Format Formulas -
		Visible: 

		
	{@Discount}
		String, Visible, Right Alignment, Top Alignment, 
		Keep Together, Expand, Using System Default Formatting, Word Wrap


	{@ShippingNote_ID760}
		String, Visible, Default Alignment, Top Alignment, 
		Keep Together, Expand, Using System Default Formatting, Word Wrap


		Object Format Formulas -
		Visible: if (IsNull({Orders.sUserDefinedShipping})) Then
  true
else
  false
		
	{@ShippingTotalCost}
		String, Visible, Right Alignment, Top Alignment, 
		Keep Together, Using System Default Formatting, Word Wrap


	{@Shipping_ID761}
		String, Visible, Right Alignment, Top Alignment, 
		Keep Together, Expand, Using System Default Formatting, Word Wrap


	{Orders.sUserDefinedShipping}
		Memo, Visible, Default Alignment, Top Alignment, 
		Keep Together, Expand, Using System Default Formatting, Word Wrap


		Object Format Formulas -
		Visible: if (IsNull({Orders.sUserDefinedShipping})) Then
  true
else
  false
		
	{@FormatHandling}
		String, Visible, Right Alignment, Top Alignment, 
		Keep Together, Using System Default Formatting, Word Wrap


	{@Handling_ID762}
		String, Visible, Right Alignment, Top Alignment, 
		Keep Together, Expand, Using System Default Formatting, Word Wrap


	{@Tax1Cost}
		String, Visible, Right Alignment, Top Alignment, 
		Keep Together, Using System Default Formatting, Word Wrap


	{@TaxNote_ID763}
		String, Visible, Default Alignment, Top Alignment, 
		Keep Together, Expand, Using System Default Formatting, Word Wrap


		Object Format Formulas -
		Visible: if (IsNull({Orders.sUserDefinedTax})) Then
  true
else
  false
		
	{Orders.sTax1Name}
		String, Visible, Right Alignment, Top Alignment, 
		Keep Together, Expand, Using System Default Formatting, Word Wrap


	{Orders.sUserDefinedTax}
		Memo, Visible, Default Alignment, Top Alignment, 
		Keep Together, Expand, Using System Default Formatting, Word Wrap


		Object Format Formulas -
		Visible: if (IsNull({Orders.sUserDefinedTax})) Then
  true
else
  false
		
	{@Tax2Cost}
		String, Visible, Right Alignment, Top Alignment, 
		Keep Together, Using System Default Formatting, Word Wrap


	{Orders.sTax2Name}
		String, Visible, Right Alignment, Top Alignment, 
		Keep Together, Expand, Using System Default Formatting, Word Wrap


	{@OrderTotalCost}
		String, Visible, Right Alignment, Top Alignment, 
		Keep Together, Using System Default Formatting, Word Wrap


	{@Total_ID765}
		String, Visible, Right Alignment, Top Alignment, 
		Keep Together, Expand, Using System Default Formatting, Word Wrap


	{Orders.sUserDefinedPayment}
		Memo, Visible, Default Alignment, Top Alignment, 
		Keep Together, Expand, Using System Default Formatting, Word Wrap


		Object Format Formulas -
		Visible: if (IsNull({Orders.sUserDefinedPayment})) Then
  true
else
  false
		
	{@PaymentNote_ID764}
		String, Visible, Default Alignment, Top Alignment, 
		Keep Together, Expand, Using System Default Formatting, Word Wrap


		Object Format Formulas -
		Visible: if (IsNull({Orders.sUserDefinedPayment})) Then
  true
else
  false
		
	ShippingProviderRateDisclaimer
		Subreport, Visible, Left Alignment, Top Alignment, 
		Keep Together, Expand


		Subreport begins

		1.0 File Information

			Report File: 		ShippingProviderRateDisclaimer
			Version: 		8.0

		2.0 Record Sort Fields

		3.0 Group Sort Fields

		4.0 Formulas

		4.1 Record Selection Formula
			{SSPProviderFeatureSetup.sVariableName} = "RATE_DISCLAIMER" and
{SSPProviderFeatureSetup.nProviderID} = {?Pm-Orders.nSSPProviderID} and
{SSPProviderFeatureSetup.nProviderID} = {?Pm-Orders.nSSPProviderID}

		4.2 Group Selection Formula
			

		4.3 Other Formulas

		5.0 Sectional Information

		5.1 Report Header Section
			Hidden

		5.2 Report Footer Section
			Hidden

		5.3 Details Section
			Visible

			Subsection.1 
				Visible, Keep Together, Suppress Blank Sections

			{SSPProviderFeatureSetup.sVariableValue}
				String, Visible, Default Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


		Subreport ends

	{@Tax_1_Exemption}
		String, Visible, Left Alignment, Top Alignment, 
		Keep Together, Expand, Using System Default Formatting, Word Wrap

	{Orders.sTax1Name}
		String, Visible, Left Alignment, Top Alignment, 
		Keep Together, Expand, Using System Default Formatting, Word Wrap


	{Orders.sTax1ExemptionData}
		Memo, Visible, Default Alignment, Top Alignment, 
		Keep Together, Expand, Using System Default Formatting, Word Wrap


	{@Tax_2_Exemption}
		String, Visible, Left Alignment, Top Alignment, 
		Keep Together, Expand, Using System Default Formatting, Word Wrap

	 
		String, Visible, Left Alignment, Top Alignment, 
		Keep Together, Expand


	{Orders.sTax2Name}
		String, Visible, Left Alignment, Top Alignment, 
		Keep Together, Expand, Using System Default Formatting, Word Wrap


	{Orders.sTax2ExemptionData}
		Memo, Visible, Default Alignment, Top Alignment, 
		Keep Together, Expand, Using System Default Formatting, Word Wrap


	PaymentsRecd
		Subreport, Visible, Default Alignment, Top Alignment, 
		Keep Together, Expand


		Subreport begins

		1.0 File Information

			Report File: 		PaymentsRecd
			Version: 		8.0

		2.0 Record Sort Fields

		3.0 Group Sort Fields

		4.0 Formulas

		4.1 Record Selection Formula
			{Orders.Order Sequence Number}={?Pm-Orders.Order Sequence Number}

		4.2 Group Selection Formula
			

		4.3 Other Formulas

			Name: {@Payments_ID766}
			Formula: "Payments"
	

			Name: {@Date_ID767}
			Formula: "Date"
	

			Name: {@OCCProvRef_ID991}
			Formula: "PSP Prov. Ref"
	

			Name: {@AuthCode_ID990}
			Formula: "Auth. Code"
	

			Name: {@Amount_ID769}
			Formula: "Amount"
	

			Name: {@Comment_ID770}
			Formula: "Comment"
	

			Name: {@PaymentType_ID768}
			Formula: "Payment type"
	

			Name: {@DateTimeActioned}
			Formula: if IsNull({PaymentHistory.DateTimeActioned}) then
			   ""
			else
			
			StringVar sYear := Left({PaymentHistory.DateTimeActioned},4);
			StringVar sMonth := Mid({PaymentHistory.DateTimeActioned},6,2);
			StringVar sDay := Mid({PaymentHistory.DateTimeActioned},9,2); 
			
			
			NumberVar nYear :=  ToNumber(Left({PaymentHistory.DateTimeActioned},4));
			NumberVar nMonth := ToNumber(Mid({PaymentHistory.DateTimeActioned},6,2));
			NumberVar nDay := ToNumber(Mid({PaymentHistory.DateTimeActioned},9,2)); 
			ToText(Date(nYear,nMonth,nDay),"dd MMM yyyy")
			
	

			Name: {@PaymentType}
			Formula: If ({PaymentHistory.PaymentType} = 0) And ({PaymentHistory.ActinicStatus} <> 7) Then
			  {@CCDebit_ID771}
			else If ({PaymentHistory.PaymentType} = 0) And ({PaymentHistory.ActinicStatus} = 7) Then
			  {@TestCCDebit_ID772}
			else If ({PaymentHistory.PaymentType} = 1) Then
			  {@CCCredit_ID773}
			else If ({PaymentHistory.PaymentType} = 2 And {PaymentHistory.Currency} = "GBP") Then
			  {@DCDebitUK_ID774}
			else If ({PaymentHistory.PaymentType} = 2 And {PaymentHistory.Currency} <> "GBP") Then
			  {@DCDebit_ID775}
			else If ({PaymentHistory.PaymentType} = 3 And {PaymentHistory.Currency} = "GBP") Then
			  {@DCCreditUK_ID776}
			else If ({PaymentHistory.PaymentType} = 3 And {PaymentHistory.Currency} <> "GBP") Then
			  {@DCCredit_ID777}
			else If ({PaymentHistory.PaymentType} = 4) Then
			  {@WalletDebit_ID778}
			else If ({PaymentHistory.PaymentType} = 5) Then
			  {@WalletCredit_ID779}
			else If ({PaymentHistory.PaymentType} = 6 And {PaymentHistory.Currency} = "GBP") Then
			  {@ChequeRec_ID780}
			else If ({PaymentHistory.PaymentType} = 6 And {PaymentHistory.Currency} <>"GBP") Then
			  {@CheckRec_ID781}
			else If ({PaymentHistory.PaymentType} = 7 And {PaymentHistory.Currency} = "GBP") Then
			  {@ChequeSent_ID782}
			else If ({PaymentHistory.PaymentType} = 7 And {PaymentHistory.Currency} <> "GBP") Then
			  {@CheckSent_ID783}
			else If ({PaymentHistory.PaymentType} = 8) Then
			  {@CashRec_ID784}
			else If ({PaymentHistory.PaymentType} = 9) Then
			  {@CashSent_ID785}
			  // 10 == CCAuthorised
			else if ({PaymentHistory.PaymentType} = 11) Then
			  {@CCPending_ID2106}
			
	

			Name: {@Amount}
			Formula: //
			// Put the specific field being converted in here
			//
			numberVar dPrice := Round({PaymentHistory.Amount});
			//
			// if the status of this row is CC pending set the amount to 0, this row is only really
			// included to get the transaction number
			//
			if ({PaymentHistory.PaymentType} = 11) then
			    dPrice := 0;
			//
			// All of the following code should stay the same
			//
			numberVar dOriginalPrice := dPrice;
			stringVar array sThouFormat := ["#","##","###","#,###","##,###","###,###","#,###,###","##,###,###","###,###,###","#,###,###,###"];
			stringVar array sDecFormat := ["", "0", "00", "000", "0000"];
			stringVar sThous := {currencies.SMONTHOUSANDSEP};
			stringVar sDec := {currencies.SMONDECIMALSEP};
			numberVar nDigits := {currencies.ICURRDIGITS};
			numberVar dDecimalPrice;
			numberVar dPos := 1;
			if (dPrice < 0) then
			   dPos := 0;
			if (dPrice < 0) then
			   dPrice := Abs(dPrice);
			dDecimalPrice := 0;
			if (nDigits = 1) then
			   dDecimalPrice :=Abs( Round(10 * ((dPrice / 10) - Truncate(dPrice / 10))));
			if (nDigits = 1) then
			   dPrice := dPrice / 10;
			if (nDigits = 2) then
			   dDecimalPrice := Abs(Round(100 * ((dPrice / 100) - Truncate(dPrice / 100))));
			if (nDigits = 2) then
			   dPrice := dPrice / 100;
			if (nDigits = 3) then
			   dDecimalPrice := Abs(Round(1000 * ((dPrice / 1000) - Truncate(dPrice / 1000))));
			if (nDigits = 3) then
			   dPrice := dPrice / 1000;
			if (nDigits = 4) then
			   dDecimalPrice := Abs(Round(10000 * ((dPrice / 10000) - Truncate(dPrice / 10000))));
			if (nDigits = 4) then
			   dPrice := dPrice / 10000;
			//
			// Work out how many digits in the result
			//
			dPrice := Truncate(dPrice);
			numberVar nSigDigits := Length(ToText(dPrice,"#"));
			if (nSigDigits > 10) then
			   nSigDigits :=10;
			if (nSigDigits < 1) then
			   nSigDigits := 1;
			//
			// Construct format string - thousands side plus decimal side
			//
			stringVar sActualFormat := sThouFormat[nSigDigits];
			//
			// Carry out the conversion and then determine required format
			//
			stringVar sValue := ToText(dPrice,sActualFormat,0,sThous,sDec);
			if (nDigits <> 0) then
			   sValue := sValue + sDec + ToText(dDecimalPrice, sDecFormat[nDigits+1],0);
			if (dPos = 1 And {currencies.ICURRENCY} = 0) then
			     {currencies.SCURRENCY} + sValue
			else if (dPos = 1 And {currencies.ICURRENCY} = 1) then
			     sValue  + {currencies.SCURRENCY}
			else if (dPos = 1 And {currencies.ICURRENCY} = 2) then
			      {currencies.SCURRENCY} + " " + sValue
			else if (dPos = 1 And {currencies.ICURRENCY} = 3) then
			     sValue  + "  " + {currencies.SCURRENCY}
			else if (dPos = 0 And {currencies.INEGCURR} = 0) then
			    "(" + {currencies.SCURRENCY} + sValue + ")"
			else if (dPos = 0 And {currencies.INEGCURR} = 1) then
			    "-" + {currencies.SCURRENCY} + sValue
			else if (dPos = 0 And {currencies.INEGCURR} = 2) then
			    {currencies.SCURRENCY} + "-" + sValue
			else if (dPos = 0 And {currencies.INEGCURR} = 3) then
			    {currencies.SCURRENCY} + sValue + "-"
			else if (dPos = 0 And {currencies.INEGCURR} = 4) then
			    "(" + sValue + {currencies.SCURRENCY} + ")"
			else if (dPos = 0 And {currencies.INEGCURR} = 5) then
			    "-" + sValue + {currencies.SCURRENCY}
			else if (dPos = 0 And {currencies.INEGCURR} = 6) then
			    sValue +"-" + {currencies.SCURRENCY}
			else if (dPos = 0 And {currencies.INEGCURR} = 7) then
			    sValue + {currencies.SCURRENCY} + "-"
			else if (dPos = 0 And {currencies.INEGCURR} = 8) then
			    "-" + sValue + " " + {currencies.SCURRENCY}
			else if (dPos = 0 And {currencies.INEGCURR} = 9) then
			    "-" + {currencies.SCURRENCY} + " " + sValue
			else if (dPos = 0 And {currencies.INEGCURR} = 10) then
			    sValue + " " + {currencies.SCURRENCY} + "-"
			else if (dPos = 0 And {currencies.INEGCURR} = 11) then
			    {currencies.SCURRENCY} + " " + sValue + "-"
			else if (dPos = 0 And {currencies.INEGCURR} = 12) then
			    {currencies.SCURRENCY} + " -" + sValue
			else if (dPos = 0 And {currencies.INEGCURR} = 13) then
			    sValue+ "- "  + {currencies.SCURRENCY}
			else if (dPos = 0 And {currencies.INEGCURR} = 14) then
			    "(" + {currencies.SCURRENCY} + " " + sValue + ")"
			else if (dPos = 0 And {currencies.INEGCURR} = 15) then
			    "(" + sValue + " " + {currencies.SCURRENCY} +")"
			else
			     {@FormatError_ID787}
	

		5.0 Sectional Information

		5.1 Report Header Section
			Visible, New Page Before

			{@Payments_ID766}
				String, Visible, Left Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


			{@Date_ID767}
				String, Visible, Left Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


			{@OCCProvRef_ID991}
				String, Visible, Horizontal Centre Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


			{@AuthCode_ID990}
				String, Visible, Right Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


			{@Amount_ID769}
				String, Visible, Right Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


			{@Comment_ID770}
				String, Visible, Left Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


			{@PaymentType_ID768}
				String, Visible, Default Alignment, Top Alignment, 
				Keep Together, Using System Default Formatting, Word Wrap


		5.2 Report Footer Section
			Hidden, New Page After

		5.3 Details Section
			Visible

			Subsection.1 
				Visible, Keep Together

			{@DateTimeActioned}
				String, Visible, Default Alignment, Top Alignment, 
				Keep Together, Using System Default Formatting, Word Wrap


			{@PaymentType}
				String, Visible, Default Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


			{@Amount}
				String, Visible, Right Alignment, Top Alignment, 
				Keep Together, Using System Default Formatting, Word Wrap


			{PaymentHistory.Comment}
				Memo, Visible, Default Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


			{PaymentHistory.CCAuthCode}
				String, Visible, Right Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


			{PaymentHistory.OCCProviderRef}
				String, Visible, Horizontal Centre Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


		Subreport ends

	{@AdjustmentMessage}
		String, Visible, Left Alignment, Top Alignment, 
		Keep Together, Expand, Using System Default Formatting, Word Wrap


	ShippingProviderRateDisclaimer - 01
		Subreport, Visible, Left Alignment, Top Alignment, 
		Keep Together, Expand


		Subreport begins

		1.0 File Information

			Report File: 		ShippingProviderRateDisclaimer - 01
			Version: 		8.0

		2.0 Record Sort Fields

		3.0 Group Sort Fields

		4.0 Formulas

		4.1 Record Selection Formula
			{SSPProviderFeatureSetup.nProviderID} = {?Pm-Orders.nSSPProviderID} and
{SSPProviderFeatureSetup.sVariableName} = "TRADEMARKS"
and
{SSPProviderFeatureSetup.nProviderID} = {?Pm-Orders.nSSPProviderID}

		4.2 Group Selection Formula
			

		4.3 Other Formulas

		5.0 Sectional Information

		5.1 Report Header Section
			Hidden

		5.2 Report Footer Section
			Hidden

		5.3 Details Section
			Visible

			Subsection.1 
				Visible, Keep Together, Suppress Blank Sections

				Format Formulas

				Visible		: 		

		
			{SSPProviderFeatureSetup.sVariableValue}
				String, Visible, Default Alignment, Top Alignment, 
				Keep Together, Expand, Using System Default Formatting, Word Wrap


		Subreport ends

